Saturday 21 September 2013

What is a structure

What is a structure?

A structureprovides a way to define a collection of data having similar attributes.
Consider, for example all students in a school. Each student has an enrolment no, name, and marks in all subjects. C provides a way to group such a set of data. This is called a structure. It is represented by the key word, 'struct'. A struct is represented as follows:
struct students
{
char student_name[25];
int mat_marks; int phy_marks; int che_marks;

} st; 

No comments:

Post a Comment