Easy learning with example program codes

C Array of Structures

C Array of Structures:

In order to store multiple data of different data types, an array of structures is used.


#include <string.h>
struct student 	 
int roll_no; 	 
char name[30]; 	 
void main( )    
struct student s[3];
int i;
s[0].roll_no = 1;    
strcpy(s[0].name, "Vibhuti Singh");
s[1].roll_no = 2;    
strcpy(s[1].name, "Yashvendra Singh");
s[2].roll_no = 3;    
strcpy(s[2].name, "Pankaj Mittal");
printf( "Student Enrollment No. : %d\n", s[i].roll_no);    
printf( "Student Name : %s\n\n", s[i].name);    


Student Enrollment No. : 1
Student Name : Vibhuti Singh
Student Enrollment No. : 2
Student Name : Yashvendra Singh
Student Enrollment No. : 3
Student Name : Pankaj Mittal
Posted in C   

Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at


We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on

Copyright © 2019 CodesJava Protection Status SiteMap Reference: Java Wiki