c++ 文件增加#ifndef、#define 和 #endif 语句的意义

文件currency.h (或 currencyOverload.h) 包含了 currency类的声明和实现细节。

在文件头, 应该加上语句

#ifndef Currency_
#define Currency_

在文件结尾加上语句

#endif

包含这组语句之内的代码只编译一次

猜你喜欢

转载自www.cnblogs.com/renfanzi/p/9244584.html
今日推荐