int main P2(int, argc, char **, argv)这个是什么意思?入口函数吗
After searching, I found a similar question on stackoverflow: why main P2((ac, av), int ac, char ** av)?
It probably means that P2 is a macro. This macro is for compatibility with older versions of compilers. For example, some early C languages are not
int main(int argc, char *argv[])
but
main(ac,av) int ac; char **av;
P2(int, argc, char **, argv)This macro will use different int main() forms depending on the compiler.
P2(int, argc, char **, argv)
int main()
There is no such syntax in C. If it can be compiled like this, P2 should be a macro
P2
#define P2 int main P2(int argc, char** argv) { return 0; }
After searching, I found a similar question on stackoverflow: why main P2((ac, av), int ac, char ** av)?
It probably means that P2 is a macro. This macro is for compatibility with older versions of compilers. For example, some early C languages are not
but
P2(int, argc, char **, argv)
This macro will use differentint main()
forms depending on the compiler.There is no such syntax in C. If it can be compiled like this,
P2
should be a macro