Write a C Program to understand pointers to structures

By | March 20, 2017

C Program to understand pointers to structures


Write a C Program to understand pointers to structures. Here’s a Simple Program to display student details using pointers to structures in C Programming Language.

This program is used to store and access “name, roll no. and marks ”  for many students using array of structures members.


C Structure : :


C Structure is a collection of different data types which are grouped together and each element in a C structure is called member.

  • If you want to access structure members in C, structure variable should be declared.
  • Many structure variables can be declared for same structure and memory will be allocated for each separately.
  • It is a best practice to initialize a structure to null while declaring, if we don’t assign any values to structure members.

Accessing Structure : : 


C structure can be accessed in 2 ways in a C program. They are,

  1. Using normal structure variable
  2. Using pointer variable

Dot(.) operator is used to access the data using normal structure variable and arrow (->) is used to access the data using pointer variable.

You have learnt how to access structure data using normal variable in C – Structure topic. So, we are showing here how to access structure data using pointer variable in below C program.


Below is the source code for C Program to understand pointers to structures which is successfully compiled and run on Windows System to produce desired output as shown below :


SOURCE CODE : :



OUTPUT  : :



If you found any error or any queries related to the above program or any questions or reviews , you wanna to ask from us ,you may Contact Us through our contact Page or you can also comment below in the comment section.We will try our best to reach upto you in the short interval.


Thanks for reading the post.

Leave a Reply