What was Wrong with void main()?

前端 未结 4 781
鱼传尺愫
鱼传尺愫 2021-01-01 16:02

Why has setting the entry point\'s return type to void in C++ always been discouraged, and was later removed by the standard and is prohibited by modern compile

4条回答
  •  执笔经年
    2021-01-01 16:42

    You generally want to know the exit status of your program. That's the reason why you have the int main() -- you return your exit status.

提交回复
热议问题