c++的.h文件如何写

这周做实验碰到这个问题,想写下来

实例


格式为:

#ifdefine 名字

#define 名字

主要代码

#endif


特别注意一个点

using namespace std;

还有你的.h文件中所用到的库都要包括进去

.h文件.cpp文件没有什么关系

.cpp文件中 #include <.h文件名>

猜你喜欢

转载自blog.csdn.net/sinat_40477296/article/details/80028493