【发布时间】:2010-11-08 02:00:44
【问题描述】:
可能重复:
Difference between pointer variable and reference variable in C++
我什么时候应该将我的变量声明为指针与通过引用传递的对象?它们在汇编中编译成相同的东西(至少在运行时渐近)所以我什么时候应该使用哪个?
void foo(obj* param)
void foo(obj& param)
【问题讨论】:
-
stackoverflow.com/questions/57483/… 的骗子还有很多很多
标签: c++ pointers reference pass-by-reference