main() functions return value?

后端 未结 5 1975
夕颜
夕颜 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:52

    The return value if the main() function is used as the exit status code of the program.

    In a shell you can get the exit status of a program using $?, example:

    ./prog
    exit_status=$?
    

提交回复
热议问题