/* 'typedef' - allows us to define new types in terms of existing C types. this is useful when groups of variables need to be changed at some later point. The statement: 'typedef int WHOLE;' creates a new data type called WHOLE which is equivalent to int. This is cool because say you defined 20 variables with WHOLE, and they now need to be long instead of int, you can easily increase them by just changing 'typedef int WHOLE' to 'typedef long WHOLE' (or 'typedef char WHOLE' if u need it redueced) 'structure' - allows us to group variables of different types into on variable. once a structure is defined, it can be used much the same as any other varible. (see examples below)... */ /************ EXAMPLE 01 *************/ struct student { char name[20]; int scores[4]; int average; } struct student class[20]; //creates an array named class which has 20 elements //code to print array element six (can put this in Main) printf("Name - %s\n", class[6].name); printf("Scores - %d %d %d %d \n", class[6].scores[0], class[6].scores[1], class[6].scores[2],class[6].scores[3]); printf("Average - %d", class[6].average); /************ EXAMPLE 02 *************/ struct error { char *descrip; char *chapter; } struct error probtab[7]; probtab[0].descrip = "no error"; probtab[0].chapter = "xxx"; probtab[1].descrip = "double negative"; probtab[1].chapter = "glossary"; probtab[2].descrip = "spelling (there/their)"; probtab[2].chapter = "glossary"; probtab[3].descrip = "usage (a lot/alot)"; probtab[3].chapter = "glossary"; probtab[4].descrip = "noun as adjective"; probtab[4].chapter = "glossary"; probtab[5].descrip = "noun as adjective"; probtab[5].chapter = "5b"; probtab[6].descrip = "correlative conjunction"; probtab[6].chapter = "5d";