Computer Science, asked by sachinslg5284, 10 months ago

Difference between pointer and reference with example

Answers

Answered by rahul72799
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 dimplesharma59
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