Declare main prototype

前端 未结 5 1591
逝去的感伤
逝去的感伤 2020-11-27 08:11

Is there any reason why I never see main\'s prototype declared in C programs, ie:

int main(int argc, char* argv[]);

int main(int argc, char* argv[])
{
    r         


        
5条回答
  •  执念已碎
    2020-11-27 08:59

    There's no need for a prototype, since main shouldn't be called by other procedures (and in C++ calling main is actually forbidden).

提交回复
热议问题