November 22, 2006 at 5:41 am · Filed under C++ misc
What is the difference between pointer and a reference?
can u assign a reference to Null?
Permalink
A reference is an alias to an existing variable.It is like a constant pointer. A constant poninter cannot be pointed to another object(Memory) once it is initialized.
int a =10;int * cont ptr = &a; this is equal to …..int& ref=a;
RSS feed for comments on this post · TrackBack URI
Name (required)
E-mail (required)
URI
Notify me of follow-up comments via email.
Rajiv said
A reference is an alias to an existing variable.It is like a constant pointer. A constant poninter cannot be pointed to another object(Memory) once it is initialized.
int a =10;
int * cont ptr = &a;
this is equal to …..
int& ref=a;