Tag: 主要的

main()的多重定义

嗨伙计们试图使用两个main()并获得此错误多次定义main()。 我重命名了我的主要function然后为什么是这个错误,并且首先在这里为我的print()定义。 头文件: #ifndef TOP_H_ #define TOP_H_ #include #include #define onemain main #define twomain main inline void print(); #endif /* TOP_H_ */ c文件一: #include “top.h” void print(); int onemain() { print(); return 0; } void print() { printf(“hello one”); } c文件二: #include “top.h” void print(); int twomain() { print(); return 0; } void print() { […]