Can two pointer variables point to the same memory Address?
Yes, two pointer variables can point to the same object:
Pointers are variables whose value is the address of a C object, or the null pointer.
multiple pointers can point to the same object:
char *p, *q; p = q = "a";
a pointer can even point to itself:
void *p; p = &p;
here is another example with a doubly linked circular list with a single element: the
next
andprev
links both point to the same location, the structure itself:struct dlist { struct dlist *prev, *next; int value; } list = { &list, &list, 0 };
Yes it does! Multiple pointers can point to the same thing.