开发者

Exit function On Linux

开发者 https://www.devze.com 2022-12-16 00:02 出处:网络
When rea开发者_JAVA百科ding/writing a file in my application, I want to exit(1) if the file is not closed correctly. On Windows it works well, but on Linux this error appears:

When rea开发者_JAVA百科ding/writing a file in my application, I want to exit(1) if the file is not closed correctly. On Windows it works well, but on Linux this error appears:

‘exit’ was not declared in this scope

How can I solve that?

Thanks.


If this is in C, did you #include <stdlib.h>?


If this is C++ you have to include cstdlib:

#include <cstdlib>
0

精彩评论

暂无评论...
验证码 换一张
取 消