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
an operation between an integer and real always yeilds a) integer result b) real result c) float result
what do you mean by volatile variable?
What is function prototyping? What are its advantages?
What do you mean by function overriding & function overloading in c++?
What does asterisk mean in c++?
What are built-in functions? What is the syntax for the definition?
Is map sorted c++?
Can we specify variable field width in a scanf() format string? If possible how?
What is #include ctype h in c++?
What is #include c++?
What is the full form of dos?
Explain the difference between using macro and inline functions?
Why was c++ made?
What are structs in c++?
When does the c++ compiler create temporary variables?