does c++ standard prohibit the void main() prototype?

前端 未结 6 1800
隐瞒了意图╮
隐瞒了意图╮ 2020-12-11 18:27

In section 3.6.1.2 of both C++ Standard 1998 and 2003 editions,

An implementation shall not predefine the main function. This function shall not be ov

6条回答
  •  悲&欢浪女
    2020-12-11 18:46

    As far as parameters are concern ,it allows

    1. int main()

    2. int main(int argc , char * argv[])

    3. int main(int argc , char * argv[] , char * envr[])

    But as per standard return type should be int for consistency purpose.

提交回复
热议问题