A structure pointer is defined as the pointer which points to the address of the memory block that stores a structure known as the structure pointer. Complex data structures like Linked lists, trees, graphs, etc. are created with the help of structure pointers. The structure pointer tells the address of a structure in memory by pointing the variable to the structure variable.
Accessing the Structure Member with the Help of Pointers
There are two ways to access the members of the structure with the help of a structure pointer:
With the help of (*) asterisk or indirection operator and (.) dot operator.
With the help of ( ) Arrow operator.
Below is the program to access the structure members using the structure pointer with the help of the dot operator.
Below is the program to access the structure members using the structure pointer with the help of the Arrow operator. In this program, we have created a Structure Student containing structure variable s. The Structure Student has roll_no, name, branch, and batch.