Creating an alias for a C-type

The typedef keyword allows the definition of an alias name for a known type. The most important reason to do so is to achieve better portability and evolution of C programs. Remember: The same C type (e.g. int) can have different sizes on different hardware or compilers. To make a program easily adjustable to different type sizes one defines new types with a program-specific meaning. If the program is ported to new hardware with different int size, only the typedef file is adjusted and the program is recompiled on the new platform.

file myTypeDefs.h:
   typedef char byte;
   typedef int INT32;
   typedef short INT16;
   typedef long INT32;

used in myProgram.c:

   #include myTypeDefs.h
  
   byte b = 0xff;  // only the programs own type definitions
   INT32 i = 12345; // are used.