What is the difference between reference type and pointers.
Answer Posted / manoj kumar kar
Difference 1>
Reference must point to valid objects at the time of
declaration where pointer need not point to valid objects
at the time of declaration means
int nvalue=5;
int &rnvalue; //This is invalid.
int &rnvalue=nvalue; //This is valid.
But
int *rnvalue; //This is valid.
rnvalue=&nvalue;
Difference 2>
Pointer is a variable which holds the address of another
variable.
But Reference is another name of the same variable.
Is This Answer Correct ? | 18 Yes | 1 No |
Post New Answer View All Answers
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
What is the difference between reference and pointer?
What are the advantage of using register variables?
Define pure virtual function?
What does it mean to declare a destructor as static?
Why is c++ considered difficult?
Is empty stack c++?
Explain storage qualifiers in c++.
Is it possible to have a recursive inline function in c++?
What is the difference between map and hashmap in c++?
What is the most useful programming language?
Why are arrays usually processed with for loop?
What do you mean by static variables?
What are stacks?
How do I exit turbo c++?