Mar*_*arc 0 c++ include c-preprocessor
我想知道是否#include也意味着"使用".如果没有,你能否告诉我编译器将对额外文件,包含的函数做什么?如果是,这是否意味着他们在输出PE中分配了他们的记忆?
#include "file.h"告诉预处理器打开file.h并将此文件的内容与您编写的当前文件合并#include "file.h".
也就是说,如果您有两个文件:
//file.h
extern int x;
//file.cpp
#include "file.h"
int x;
void f()
{
x = 10;
}
Run Code Online (Sandbox Code Playgroud)
然后预处理器副本的内容file.h来file.cpp为:
extern int x; //came from file.h
int x;
void f()
{
x = 10;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4694 次 |
| 最近记录: |