- 论坛徽章:
- 0
|
原帖由 ypxing 于 2008-5-29 18:47 发表 ![]()
我的观点仍然是:
&a是常量,它是有类型的,类型为int*
我基本同意,但是问题依然没有解决。
标准的说法是constant address,见下面的原文,
const int a = 3;
3是常量,但a不是。如果constant address和3的性质相同,constant address就是常量,那么就完全没意见。但是constant address如果是和const int相同,那么就不是了。这里我不是很清楚。
标准原文见下:
6.2.4 Storage durations of objects
2 The lifetime of an object is the portion of program execution during which storage is
guaranteed to be reserved for it. An object exists, has a constant address,25) and retains its last-stored value throughout its lifetime.26)
25) The term ‘‘constant address’’ means that two pointers to the object constructed at possibly different times will compare equal. The address may be different during two different executions of the same program. |
|