Using own types for portability

Suppose the previous program is ported to a platform where int types are only 16 bit wide and only long types have 32 bits. With all our types definitions collected in one place: myTypeDefs.h, it is easy to make the adjustments and recompile:

file myTypeDefs.h:          changed to:
   typedef char byte;       typdef char byte;
   typedef int INT32;       typedef int INT16;  // now 16 bit
   typedef short INT16;     typedef short INT16;
   typedef long INT32;      typedef long  INT32; // use long not int 

No need to change the program besides recompiling it. The typedefs make sure that a variable that is supposed to be 32 bit wide will be created with the proper type: int on the first platform, long on the second platform.