四个cpp文件, main.cpp, first.cpp, second.cpp, lib.cpp
三个头文件, first.h, second.h, lib.h
是这样include的:
main.cpp:
#include "lib.h"
first.cpp:
#include "first.h"
second.cpp:
#include "second.h"
lib.cpp:
#include "lib.h"
#include <iostream>
first.h:
#include "lib.h"
#include "second.h"
second.h:
#include "lib.h"
#include "first.h"
编译提示错误
我知道是关于first.h和secend.h两个文件不停的包含, 但是second.h必须用到first.h中
的定义, first也必须用到second.h中的定义, 怎么解决这个问题/?
还有我想知道一下多文件程序应该如何组织, 有什么样的规律/?
解决马上给分/!