更新时间:2023-02-18 16:07:30
不要喊叫(不要只使用大写字母)!太粗鲁了!
阅读此内容: http://en.wikipedia.org/wiki/C_preprocessor [
Don''t shout (don''t use only capital letters)! It is rude!
Read this: http://en.wikipedia.org/wiki/C_preprocessor[^]
http://gcc.gnu.org/onlinedocs/cpp/Macros.html [ http://***.com/questions/1358232/why-use-macros-in-c [ ^ ]
http://gcc.gnu.org/onlinedocs/cpp/Macros.html[^]
http://***.com/questions/1358232/why-use-macros-in-c[^]
宏是C
编译器甚至看不到的东西.
根据 quick-Google-search (宏-C预处理器 [ ^ ]):
A macro is something theC
compiler not even sees.
According to the first entry in a quick-Google-search (Macros - The C Preprocessor[^]):
也就是说:
C
预处理器的东西.
That is:
C
preprocessor stuff.#define BUFSIZE 100
//...
int buf[BUFSIZE];
//...
if (k>BUFSIZE)
{
//...
}
预处理器用数字100
替换每次出现的宏BUFSIZE
,因此 C
编译器解析(类似)以下源:
the preprocessor replaces every occurrence of the macro BUFSIZE
with the number 100
, thus the C
compiler parses (something like) the following source:
//...
int buf[100];
//...
if (k>100)
{
//...
}