几个要点:
具体例子:
include guard:
/*Swmm5Extend.h*/ //if this head file is called before, nothing will be reached #ifndef SWMM5EXTEND_H //this can be everything, but SWMM5EXTEND_H is clear #define SWMM5EXTEND_H /* other head files */ #endif // !SWMM5EXTEND_H
导入其他文件夹内的头文件:
/*in the subdirectory*/ #include "/subdirectory/structure.h" /*in another directory*/ #include "../anotherdirectory/structure.h" //Linke: //https://stackoverflow.com/questions/7581408/including-a-header-file-from-another-directory
原文:https://www.cnblogs.com/kimilin/p/10367132.html