c++ - 求解C语言main函数
巴扎黑
巴扎黑 2017-04-17 15:25:44
0
2
487

int main P2(int, argc, char **, argv)这个是什么意思?入口函数吗

巴扎黑
巴扎黑

reply all(2)
洪涛

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.

伊谢尔伦

There is no such syntax in C. If it can be compiled like this, P2 should be a macro

#define P2
int main P2(int argc, char** argv) {
    return 0;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!