CSC209H1 Chapter 6: DISCOVER Useful C Features - Part 1 of 1
Document Summary
Defines a keyword that is replaced by a specified string. This does not create a new type in the sense that structs do: not creating a new, composite type with components that have their own names. It provides a new name for an existing type. We might not know how to use the type. We can pass in age_t when supposed to be a "shoe_size_t" Compiler will not complain about this since both have the type unsigned int. Thus, cannot rely on the complier to point out the error but has to read the typedefs. And this is why we have header files. Header files store declarations away from definitions, to assist with ease of reading -- and to allow compilers to do some basic checks. Typedef easier to read for structs: ( ) we can even omit the student here.