【发布时间】:2012-04-08 14:15:17
【问题描述】:
(variable = &anotherVar) 的大小是多少
int y = 10; // the size of y is 4 bytes
int & x = y; // what is the size of x that receives the address of y
【问题讨论】:
-
不能引用标准,但 32 位或 64 位取决于目标 CPU 架构。
-
@Corbin : 和 y 的大小一样吗?
-
@faressoft 可能,但它没有被定义为那样,所以你不能指望它。
-
您的问题不一致。 (variable = & anotherVar) 与 type & x + anothervar 不同。你问的是哪两个问题?
标签: c++ reference pass-by-reference sizeof