C语言复习(八)---头文件的高级操作
一般操作
使用头文件导入库函数和宏定义时,通常使用#include<stdio.h>或#include"my_library"来导入编译器自带的函数或自己编写的函数
只引用一次头文件
使用#ifndef来实现只引用一次的作用
ex
#ifndef MY_LIBRARY
#define MY_LIBRARY
/*
...*/
#endif
条件引用
使用#if,#elif和#else嵌套可以得到条件引用的效果
ex:
#if TEST1
#include "test1.h"
#elif TEST2
#include "test2.h"
#else
#include "test3.h"
/*
...
*/
#endif

浙公网安备 33010602011771号