Is main() overloaded in C++?

后端 未结 6 1692
再見小時候
再見小時候 2020-11-29 01:51

2 valid versions of main() exist in C++:

int main()  // version 1
int main(int argc, char **argv)  // version 2

B

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 02:13

    It is not possible to overload main() in C++ because. the compiler shown the following error:

    error C2731: 'main' : function cannot be overloaded 
    

提交回复
热议问题