TOPIC 10.3.1
Typedefs
The typedef command does not preform any operational function, yet it may make programing a bit easier when moving among compilers. As you saw earlier the bool type can be created by the following three lines of code:
typedef int bool; const int TRUE= 1; const int FALSE = 0;
What happens when you do move from a compiler that does not support the bool type, to a compiler that does support it. If you really wanted to uses the bool type, it would be much easier to comment out the three lines of code than it would be to change every int to bool, every 1 to TRUE, and every 0 to FALSE.
The typedef command can also be used to create aliases of variable arrays, as show below.
typedef int matrix[5][5]; typedef int vector[5];
The identifier matrix and vector are now array data types.