Pointer To Structure In C Programming

C Pointer to Structure

A structure pointer is a type of pointer that stores the address of a structure typed variable is called pointer to structure.


  • Address of Pointer variable can be obtained using ‘&’ operator.
  • Address of such Structure can be assigned to the Pointer variable.
  • Pointer Variable which stores the address of Structure must be declared as Pointer to Structure.

Declaring Pointer to Structure

struct studentStruct
    char name[10];
    int roll;
    int marks;
struct studentStruct *ptr;
ptr = &student1;

Example 1:


 Today's date is 17/18/2019.

Example 2:


 Roll Number : 21
 Marks of Student : 90
 Press any key to continue