C - Structured Datatypes
A structure in C is a collection of items of different types. You can think of a structure as a "record" is in Pascal or a class in Java without methods. Structures, or structs, are very useful in creating data structures larger and more complex than the ones we have discussed so far. Simply you can group various built-in data types into a structure. Object conepts was derived from Structure concept. You can achieve few object oriented goals using C structure but it is very complex. Following is the example how to define a structure. struct student { char firstName[20]; char lastName[20]; char SSN[9]; float gpa; }; Now you have a new datatype called student and you can use this datatype define your variables of student type: struct student student_a, student_b; or an array of students as struct student students[50]; Another way to declare the same thing is: struct { char firstName[20]; char lastName[20]; char SSN[10]; ...