Should I return EXIT_SUCCESS or 0 from main()?

前端 未结 8 1088
梦毁少年i
梦毁少年i 2020-11-27 09:54

It\'s a simple question, but I keep seeing conflicting answers: should the main routine of a C++ program return 0 or EXIT_SUCCESS?

         


        
8条回答
  •  有刺的猬
    2020-11-27 10:09

    Some compilers might create issues with this - on a Mac C++ compiler, EXIT_SUCCESS worked fine for me but on a Linux C++ complier I had to add cstdlib for it to know what EXIT_SUCCESS is. Other than that, they are one and the same.

提交回复
热议问题