- Size of Data Types
- Always use sizeof() to get the size of types(sizeof(char), sizeof(short), sizeof(int)...)
- Do not depend on the order of evaluation in an expression
- Char type may be singed or unsigned. Better to use an integer to store the output of getchar().
- Use standard Libraries
- Write platform-specific code is possible.
Reference from http://www.cs.princeton.edu/courses/archive/spring06/cos217/lectures/24portable.pdf