宏存储在哪里? [英] Where are macros stored?

查看:404
本文介绍了宏存储在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在C代码中使用了宏,例如

If I use macros in my C code, such as

#define var 10

那么内核在分配给进程的空间中到底存储了什么? 在堆还是BSS或全局数据中?还是只是其中一个编译器遍历中的var的文本替换?

then where exactly are the stored in the space allocated to the process by the kernel? In heap or BSS or global data? Or is it just a text replacement for var in one of the compiler passes?

推荐答案

是.
最后一个

Yes.
the last one

只是文本替换

通过预处理过程执行. 可以在此处

It is performed by a preprocessing pass. Some good details can be found here

这篇关于宏存储在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆