当前位置:网站首页>Share a multiple-choice question about define (including the replacement rules, program environment and preprocessing related knowledge of define during precompiling)
Share a multiple-choice question about define (including the replacement rules, program environment and preprocessing related knowledge of define during precompiling)
2022-07-27 05:36:00 【vpurple__】
Title
Catalog
Recommended reading order :
1. subject ->3. answer ->2. Topic analysis ->4. Topic knowledge
1. subject
1、 Perform the following procedure , The correct output is ( )
The following macro definitions are provided :
#define N 3+1
#define Y(n) ((N+1)*n)Then execute the statement z=2*(N+Y(5+1)) after ,z The value of is ()
A、60 B、190 C、248 D、 None of the above answers is correct
2. Topic analysis
This is a very typical #define The topic of the replacement rule of .

3. Question answer
right key : A、60
4. Topic knowledge
4.1define Replacement rules
Extend... In a program #define When defining symbols and macros , There are several steps involved .
1. When calling a macro , First, check the parameters , See if it contains any information from #define Defined symbols . If it is , They are replaced first .
2. The replacement text is then inserted into the program at the location of the original text . For macros , Parameter names are replaced by their values .
3. Last , Scan the result file again , See if it contains any information from #define Defined symbols . If it is , Just repeat Describe the process .

Please note that :
Macro parameters are not entered after calculation, but directly replaced .

For more relevant knowledge, please see my blog :
Hello everyone , This is Yuanzai ! Welcome to Yuanzai's topic sharing column , This should be used as Yuanzai's mistake book in the future , Record fallible or classic topics and share them with you . Thank you for reading to the end , If there is any mistake or omission, please send me a private message .
The source of this topic is me c The test questions of language class , A little sigh , If I didn't fall asleep before class , Listen carefully , This question won't be wrong when I evaluate . Fortunately, there was a recording , It's not too late to mend .
I hope I can work harder next , Make progress with everyone !!

边栏推荐
- Notes Series docker installation PostgreSQL 14
- Localdatetime and zoneddatetime
- Niuke sword refers to the path in the offer--jz12 matrix
- Student management system
- 背景图片相关应用-铺满,自适应
- Seckill system design
- 创建项目 实现登录注册,生成jwt,发送验证码
- redis发布订阅模式
- Three waiting methods of selenium and three processing methods of alert pop-up
- arguments
猜你喜欢

初始C语言——关键字static的作用

JVM part I: memory and garbage collection part II -- class loading subsystem

Hi3516dv300 environment setup

接收方设置并发量和限流

redis集群

分享一道关于程序编译过程的选择题(内含编译过程浅谈,符号表的形成合并过程)

李宏毅机器学习组队学习打卡活动day03---误差和梯度下降

Li Hongyi machine learning team learning punch in activity day02 --- return

后台频道组管理功能实现

DNSmasq使用总结
随机推荐
Makefile is easy to understand and explain
Redis publish subscribe mode
torch中乘法整理,*&torch.mul()&torch.mv()&torch.mm()&torch.dot()&@&torch.mutmal()
异步数据-短信验证码
Li Hongyi machine learning team learning punch in activity day02 --- return
Source code of document type full-text retrieval knowledge base management system
Flask的传参以及返回的响应
后台实现spu管理
订单系统功能实现
Li Hongyi machine learning team learning punch in activity day03 --- error and gradient decline
GCC compilation options
SQL database → constraint → design → multi table query → transaction
while循环
事务,订单系统添加事务
小米商城项目_注册
C语言函数入门介绍
时间复杂度与空间复杂度
登录到主页功能实现
如何查看导师的评价
C语言入门介绍