Yes two pointer variable can point to the same memory address.
As we know that pointer is a variable which contains address of same data type. Consider the following example in C
#include<stdio.h>
int main() {
int a,*pointer1;
a = 10;
pointer1 = &a;
int *pointer2;
printf("\n Val : %d",*pointer1); //This contains address of the variable a - so accessing it with * prints its value - value of “a"
printf("\n Val : %d", *pointer2); //This contains some junk value - so accessing it with * causes segmentation fault - since there might not be memory address with that junk value
pointer2 = pointer1; //Now pointer1 reference i.e.; address value stored in pointer1 is made a copy and now both pointer1 and pointer2 will point to the same memory location
printf("\n Val : %d", *pointer2); //Now this would print the value of “a"
return -1;
}
The same applies to linked list address. Your variable “p” and “temp” would point to the same memory address now !