h*****n 发帖数: 209 | 1 【 以下文字转载自 JobHunting 讨论区 】
发信人: hanuman (神猴), 信区: JobHunting
标 题: C语言里面的register变量能否进行取地址操作?
发信站: BBS 未名空间站 (Sat Nov 20 18:19:03 2010, 美东)
一直不是很清楚,C语言里面的register变量有它的内存地址吗?
比如说: register int a=3; 那么&a代表什么意思呢? | X****r 发帖数: 3557 | 2 在C99里是不允许取register变量的地址的,见
6.5.3.2 Address and indirection operators
Constraints
1 The operand of the unary & operator shall be
either a function designator, the result of a []
or unary * operator, or an lvalue that designates
an object that is not a bit-field and is not
declared with the register storage-class specifier.
【在 h*****n 的大作中提到】 : 【 以下文字转载自 JobHunting 讨论区 】 : 发信人: hanuman (神猴), 信区: JobHunting : 标 题: C语言里面的register变量能否进行取地址操作? : 发信站: BBS 未名空间站 (Sat Nov 20 18:19:03 2010, 美东) : 一直不是很清楚,C语言里面的register变量有它的内存地址吗? : 比如说: register int a=3; 那么&a代表什么意思呢?
|
|