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
How can you link a c++ program to c functions?
Explain the difference between struct and class in terms of access modifier.
Write bites in Turbo c++ Header ("Include") Files.
How long it will take to learn c++?
Explain stack unwinding.
Define token in c++.
What is data type in c++?
Search for: what is pair in c++?
How can you specify a class in C++?
What is prototype in c++ with example?
What is the use of lambda in c++?
Describe friend function & its advantages.
What is the main purpose of c++?
What information can an exception contain?
What is the difference between passing by reference and passing a reference?