What does int argc, char *argv[] mean?

前端 未结 8 2125
萌比男神i
萌比男神i 2020-11-21 05:18

In many C++ IDE\'s and compilers, when it generates the main function for you, it looks like this:

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

When I

8条回答
  •  无人共我
    2020-11-21 05:48

    Both of

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

    are legal definitions of the entry point for a C or C++ program. Stroustrup: C++ Style and Technique FAQ details some of the variations that are possible or legal for your main function.

提交回复
热议问题