Structures

Structures

A facility for grouping data into composite forms

struct fraction {
	int numerator; 
	int denominator;
};

Usage:

struct fraction f1, f2; 
f1.numerator = 22; 
f1.denominator = 7; 

f2 = f1; // copies over the whole struct 

Arrays

A simple type of array in C is one that is declared in place. There are more complication use that are related to pointers.

int scores[100]; //0 to 99 hold 100 integers