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

边栏推荐
- C语言函数入门介绍
- c语言字符串函数下:strcmp、strncpy、strncat、strncmp、strstr、strtok、strerror
- Li Hongyi machine learning team learning punch in activity day05 --- skills of network design
- Day5 --- Flask-RESTful请求响应与SQLAlchemy基础
- numpy 数据类型转化
- 268.missing number of leetcode
- Utility gadget: kotlin code snippet
- 如何查看导师的评价
- 通用视图,DRF视图回顾
- Find the number of combinations (the strongest optimization)
猜你喜欢

Utility gadget: kotlin code snippet

如何将Excel表格中的多列内容合并到一列

初识C语言——为什么每个C程序都有一个main函数

分享一道关于#define的选择题(内含#define在预编译时的替换规则,程序环境和预处理相关知识)

The concept of cloud native application and 15 characteristics of cloud native application

Day3 ---Flask 状态保持,异常处理与请求钩子

Li Hongyi machine learning team learning punch in activity day04 - Introduction to deep learning and back propagation mechanism

创建项目 实现登录注册,生成jwt,发送验证码

登录到主页功能实现

程序环境和预处理(上):一个程序是怎么成功运行的?
随机推荐
Redis cluster
Makefile is easy to understand and explain
cookie增删改查和异常
c语言字符串函数上:strlen、strcpy、strcat
2021 Niuke multi school training camp 5 (question b)
初识C语言——常见的数据类型
[codeworks round 801 div2 D tree queries] tree greedy conclusion
Seckill system design
注册功能实现
Qsort - the sorting function in C language (with void*, callback function knowledge points
后台实现spu管理
蓝图-类视图方法
C语言做一个小迷宫
Li Hongyi machine learning team learning punch in activity day02 --- return
用pygame自己动手做一款游戏01
Differences among bio, NiO and AIO
Niuke sword refers to the path in the offer--jz12 matrix
SQL(MySql)菜鸟教程知识
努力进化中_我的第一篇csdn博客
原生token生成加密、解密