Difference between pointer and reference with example
Answers
Answered by
0
A Pointers can point nowhere ( NULL ), whereas a reference always refers to an object. You can't take the address of a reference like you can with pointers. There's no "reference arithmetic" (but you can take the address of an object pointed by a reference and do pointer arithmetic on it as in &obj + 5 ).
Answered by
1
The pointer and reference both are used to point or refer the another variable. But the basic difference among both of them is that a pointer variable points to a variable whose memory location is stored in it. The reference variable is an alias for a variable which is assigned to it.
HOPE IT IS HELPFUL...
Similar questions
Social Sciences,
6 months ago
English,
6 months ago
Physics,
6 months ago
India Languages,
11 months ago
Science,
1 year ago