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

后端 未结 9 1553
佛祖请我去吃肉
佛祖请我去吃肉 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:40

    Because it just looks weird to not "return" something from a function having a non-void return type (even if the standard says it's not strictly necessary).

提交回复
热议问题