Array of structure In C

Page 1

Array of Structure In C | Programmerdouts programmerdouts.blogspot.com/2019/06/array-structure-c.html

Array of Structure Till now we have seen array of basic data types like array of int ,array of float ,array character etc. But now we will see how to make array of structure variable. So,let's define a structure Let's define a structure Student with name ,rollno, div as it's attribute.

Definition: struct student //structure name { int rollno; //member1 ,integer variable which will store, //student roll no. char name[20]; //member2 a character array of 20 character //which will store name of student. char div; //member3 a character variable, //which will store division of student. };

Syntax:Declaration of structure array struct structure_name structure_variable_name[size_of_array];

Declaration of structure student array

1/7


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.