What happens if main() does not return an int value?

前端 未结 8 1661
渐次进展
渐次进展 2020-12-03 03:19

I know that in C compilers the main() function is called by the _start() function which has code something like this:

exit(main());         


        
8条回答
  •  佛祖请我去吃肉
    2020-12-03 03:53

    The C-standard does not allow you to return any other value than int or void -- the c-compiler specifically test for the signature of main to make sure it is compatible.

提交回复
热议问题