Skip to content

Preprocessor, const, static, and enum · ⁨预处理器、const、static 与 enum⁩

English

What runs before the compiler

  • Before the compiler sees your code, the preprocessor handles every line that starts with #.
  • It pastes in headers, replaces macros, and removes comments — a simple text step.
  • You have used it already: #include <stdio.h> is a preprocessor command.

中文

在编译器之前运行的东西

  • 在编译器看到你的代码之前,预处理器会先处理每一行以 # 开头的内容。
  • 它把头文件粘贴进来、替换宏、去掉注释 —— 是一个简单的文本步骤。
  • 你已经用过它了:#include <stdio.h> 就是一条预处理命令。

预处理器把 #include 和 #define 展开成普通代码,然后编译器才运行

Handout

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩