c语的言include命令

在命令处插入一个文本文件

比如
a.cpp文件内容

int main(){
    fun();
}
#include "a.h"

a.h文件内容

int i = 1;
void fun();

//执行预编译命令

gcc -E a.cpp > temp.cpp

//查看temp.cpp文件

cat temp.cpp

内容如下:

# 1 "a.cpp"
# 1 "<built-in>"
# 1 "<命令行>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<命令行>" 2
# 1 "a.cpp"
int main(){
 func();
}
# 1 "a.h" 1
int i=1;
void fun(){
};
# 4 "a.cpp" 2

猜你喜欢

转载自blog.csdn.net/k3108001263/article/details/84504701