预处理过程的时间C语言,c语言预处理过程(C language preprocessing process).doc

c语言预处理过程(C language preprocessing process)

c语言预处理过程(C language preprocessing process)

The preprocessing process scans the source code, performs a preliminary conversion, and generates new source code for the compiler. It is evident that the preprocessing process processes the source code earlier than the compiler.

In C, there is no internal mechanism for performing some of the following functions: include other source files at compile time, define macros, and decide whether or not compile contains some code at compile time. To do this, you need to use a preprocessing program. Although most compilers today contain preprocessing programs, they are generally considered to be compiler independent. The preprocessing process reads the source code, checks the statements and macro definitions that contain the preprocessing instructions and responds to the source code. The preprocessing process also removes comments and superfluous whitespace characters in the program.

Pre processing instruction is at the beginning of the line of code to # no.. # number must be the first character in addition to any whitespace character outside. After the instruction is # keywords, allowing any number of whitespace between keywords and # no.. The row statement forms a preprocessing instruction that converts some of the source code before the compiler compiles. Here are some of the preprocessing instructions:

Instruction use

# air command, no effect

#include contains a source code file

#define definition macro

#undef cancels the defined macro

#if if the given condition is true, the following code is compiled

#ifdef if the macro has been defined, the following code is compiled

#ifndef if the macro is not defined, the following code is compiled

#elif if the preceding #if given condition is not true and the current condition is true, the following code is compiled

#endif ends an #if...... #else conditional compilation block

#error stops compiling and displays error messages

First, the file contains

The function of the #include preprocess

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值