C/C++函數返回1和返回0究竟哪個好?
資料來源: https://mp.weixin.qq.com/s/k665sVh1vaXvEXhWD1iAYQ
https://docs.microsoft.com/zh-tw/cpp/c-runtime-library/exit-success-exit-failure?view=msvc-160
線上編譯器:
https://www.tutorialspoint.com/compile_cpp_online.php
https://www.tutorialspoint.com/compile_c_online.php
常數 定義的值
EXIT_SUCCESS 0
EXIT_FAILURE 1
CODE:
#include#include int main() { printf("Hello, World!\n"); return EXIT_SUCCESS;//0; }
#include#include using namespace std; int main() { cout << "Hello World" << endl; return EXIT_SUCCESS;//0; }