c++ - What is the difference between a reference variable and a const pointer variable? -
possible duplicate:
difference between pointer variable , reference variable in c++
this continuation of this question
is reference variable name of const pointer variable? if different difference between variable declared reference variable , variable declared const pointer variable?
ok. problem there no such thing reference variable. reference not variable @ all. not object. has no size @ all. alternative name of original object.
check this:
struct { int i[5]; }; int main() { std::cout << (sizeof(a&) == sizeof(a)) << std::endl; std::cout << (typeid(a&) == typeid(a)) << std::endl; return 0; } a& has same size a& has same type
Comments
Post a Comment