c - c 宏中的原始数据类型是什么?

标签 c types

在c语言中,“int”“long”“char”“unsigned”等原始数据类型……都是宏吗? 如果是这样,它们在哪里定义?它们是如何实现的,例如“int”类型?

最佳答案

它们不是宏,它们只是被编译器转换成合适的数据存储和操作。

例如当你的程序中有:

int i;
i=5
i+=7;

编译器将它翻译成类似这样的东西:

Allocate sizeof(int) bytes in the stack
Put the number 5 in the allocated space
Retrieve the number on the allocated space, add 7 to it, and save it again at the same location

关于c - c 宏中的原始数据类型是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1695730/

相关文章:

c - 写入文件

c - C99 printf 中的可变前导零

在 QT Creator 中捕获单元测试 - main 的多个定义

c++ - 数据类型大小对性能的影响

c - 如何找出声明 C 结构的位置?

javascript - 如何键入类或构造函数

c - 翻译 C 语言中的 sscanf() 引用

c++ - Arduino 触摸代码不适用于 spark 核心

scala - 更多 Scala 打字问题

javascript - 让 TypeScript 明白对象属性不能被取消定义?