gpt4 book ai didi

chapel - 从 Chapel 设置退出值

转载 作者:行者123 更新时间:2023-12-01 04:30:53 24 4
gpt4 key购买 nike

终止 Chapel 程序时是否可以设置退出状态?
我总是可以使用:

extern "exit" proc c_exit(status:c_int);

以下是诀窍。
extern "exit" proc c_exit(status:c_int);


module M {

proc main() {

writeln("hello, world");
c_exit(1);
}
}

这将退出状态设置为 1 - 只是想知道是否有一种不需要调用 C 库的方法。

最佳答案

你可以调用exit(1)。参见 chapel docs 中的 proc 退出.

关于chapel - 从 Chapel 设置退出值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54393581/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com