当前位置:网站首页>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 !!

边栏推荐
- Li Hongyi machine learning team learning punch in activity day01 --- introduction to machine learning
- 元素显示模式:块级,行内,行内块,嵌套规范,显示模式转换
- Selenium element operation
- 初始C语言——关键字static的作用
- Multiplication sorting in torch, * & torch. Mul () & torch. MV () & torch. Mm () & torch. Dot () & @ & torch. Mutmal ()
- 李宏毅机器学习组队学习打卡活动day06---卷积神经网络
- 【codeforces 1695C Zero Path】DP
- Day5 --- Flask-RESTful请求响应与SQLAlchemy基础
- C语言入门介绍
- Redis publish subscribe mode
猜你喜欢
随机推荐
接收方设置并发量和限流
如何将Excel表格中的多列内容合并到一列
Flask登录实现
【C语言switch分支语句和循环语句】
自己动手做一个爬虫项目
后台优惠券管理
下载url-loader,用limit指定图片大小后,显示不出图片
封装JWT
Carmaker quick start lesson 4 developing 48V P1 hybrid system
Day5 --- Flask-RESTful请求响应与SQLAlchemy基础
mysql 取消外键关联约束
Rolling Division
Common commands in CONDA and pip environments
Enumeration class implements singleton mode
The receiver sets the concurrency and current limit
MQ FAQ
Flask对模型类的操作
C语言入门介绍
Dnsmasq Usage Summary
redis锁








