if i write something like this: typedef struct {int x,y;} str; . . . str A, *p = &A; int *p2 = &A.x; then cout<<*p2 prints the value of A.x and cout << p2 prints the address of A.x but if i write cout<<*p->x , compiler says "illegal indirection" and if i write cout<< p->x i get the value of A.x so why is that and how can i get the address of A.x using p pointer ?