Why typedef ?
Easy modification of data typesExample: Certain int variables are used for carrying flags. Later, the software became more complicated, and we want to change these variables into type long.Had these variables been declared of type Flag (with “typedef int Flag;”), all can be done by modifying the typedef statement.
Readability, DocumentationExample: Meaningful names for data types:In the example above, wherever we see the declaration “Flag var;” we understand that ‘var’ is going to be used as a “flag carrier”.