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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -