What the reasons for/against returning 0 from main in ISO C++?

后端 未结 9 1658
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-20 19:12

I know that the C++ standard says that return 0 is inserted at the end of main() if no return statement is given; however, I often see recently-wri

9条回答
  •  误落风尘
    2021-01-20 19:34

    By being explicit you are explicitly showing your intent.

    By relying on something implicit you could have 2 cases: 1) You intended it, 2) You forgot it.

提交回复
热议问题