Pointers to Structure

Pointer and Structures:
A pointer variable can also hold the address of a structure variable like it holds the address of an ordinary variable. Observe the following structure definition:

Point *f = &amp;P1; Point *l = &amp;P2;

One big question arises that how can we access the data members of a structure variable using these pointer variables? Now if you want to point a pointer to these two variables P1 and P2, then we have to declare the pointer variables like :

cout&lt;&lt; f-&gt;XCoord &lt;&lt; f-&gt;YCoord ;