main() functions return value?

后端 未结 5 1966
夕颜
夕颜 2020-11-30 13:27

Anyone please tell me where the main() function of the \'C\' language returns its value?

5条回答
  •  攒了一身酷
    2020-11-30 13:44

    C's main function returns an int... that int goes to the program which executed it (the parent process, if you will) as an exit status code.

    Specifically, on most operating systems, a 0 exit code signifies a normal run (no real errors), and non-zero means there was a problem and the program had to exit abnormally.

提交回复
热议问题