c语言 macro in compile time,c语言第九章习题(国外英文资料).doc

c语言第九章习题(国外英文资料)

c语言第九章习题(国外英文资料)

Chapter 9: pretreatment

pretreatment

An overview of the

In the previous chapters, you've used the preprocessor command that starts with the #. For example, include command # include, macrodefine command # define, etc. These commands are outside the function in the source program, and are generally placed in front of the source files, which are called preprocessing parts.

Preprocessing refers to the work that was done before the first scan of compilation (lexical scanning and parsing). Preprocessing is an important function of the C language, which is done by the preprocessor. When to compile a source file, the system will automatically referenced preprocessor preprocessing part of source program in processing, processed into the compilation of source code automatically.

The C language provides a variety of preprocessing functions such as macros, file inclusion, and conditional compilation. The proper use of preprocessing functions for easy reading, modification, migration, and debugging also facilitates modular programming. This chapter introduces several common preprocessing functions.

Macro definition

In the C language source program, an identifier is allowed to represent a string, called "macros". The identifier defined as "macros" is known as the "macro name". During the compilation of pretreatment, the program "macro", all in all with the string to substitution in the macro definition, which is referred to as a "macro substitution" or "macro expansion".

The macro definition is done by the macro definition command in the source program. The macro substitution is done automatically by the preprocessor. In the C language, macros are divided into parameters and parameters. The definitions and calls of these two "macros" are discussed below.

No arguments macro definition

No parameters are taken without the macro name of the macro. The general form of the definition is the # define identifier string where the "#" indicates that this is a preprocessin

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值