1.对于函数头文件:

  #include <filename>

  一般对于标准库文件以一个.h后缀结尾;

2.对于本地文件:

  #include "filename.h"

  对于处理本地头文件的一种常见方法:先在源文件所在的当前目录进行查找,如果没有找到,则到标准位置查找;

3.头文件嵌套包含时:

  当一个文件多次被包含时应在每个头文件中使用避免这种错误:

#ifndef   __HEADERNAME_H
#define  __HEADERNAME_H


#endif

4.#error

 使用#error指令允许生成错误信息;

 

相关文章:

  • 2022-12-23
  • 2021-10-04
  • 2022-12-23
  • 2021-08-19
  • 2021-09-01
  • 2021-10-27
  • 2022-12-23
猜你喜欢
  • 2021-12-28
  • 2022-01-15
  • 2021-08-27
  • 2021-06-23
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案