The typedef Keyword
• In the previous topic it was shown that enumerations
provide a way to define our own data types.
• The typedef keyword enables us to specify our own
data type name as an alternative to another type.
• Using typedef, it is possible to declare the type name
bigOnes as being equivalent to the standard type
long with the declaration:
typedef long bigOnes;
The typedef Keyword tMyn 1
• This defines bigOnes as an alternative type specifier
for long, so it is possible to declare a variable mynum
as type long with the statement:
• typedef can also fulfill a very useful role in enabling
us to simplify more complex type declarations.
The typedef Keyword tMyn 2