A pointer to a variable of structure type may exist.
Accessing a member of the structure is straight-forward:
dereference the pointer, and apply the .
operator. However, the syntax requires
parentheses to ensure the correct meaning, but a short
form also exists (and is widely used) for
convenience:
struct point loc;
struct point *locp = &loc;
(*locp).x = 10; /* correct */
*locp.x = 10; /* incorrect; same as *(locp.x)
*/
locp->x = 10; /* correct, shorter form */
Syntactically, pointers to unions are accessed identically.