Write a C Program to enter Student Details using array of structures

By | March 20, 2017

C Program to enter Student Details using array of structures


Write a C Program to enter Student Details using array of structures. Here’s a Simple Program to understand array of structures in C Programming Language.


Array of Structures


Structure is collection of different data type. An object of structure represents a single record in memory, if we want more than one record of structure type, we have to create an array of structure or object.

As we know, an array is a collection of similar type, therefore an array can be of structure type. You can store “n” number of students record by declaring structure variable as ‘struct student record[n]“, where n can be 1000 or 5000 etc.

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


Syntax for declaring structure array : :


struct struct-name
{
datatype var1;
datatype var2;
– – – – – – – – – –
– – – – – – – – – –
datatype varN;
};

struct struct-name obj [ size ];


Accessing Structure Members


To access any member of a structure, we use the member access operator (.). The member access operator is coded as a period between the structure variable name and the structure member that we wish to access. You would use the keyword struct to define variables of structure type.


Below is the source code for C Program to enter Student Details using array of 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