What are the things that I should keep in mind to write portable code? Since I\'m a c++ beginner, I want to practice it since beginning.
Thanks.
Use STL types when possible. Be careful of using system dependent types and APIs. For example don't use types like UINT, and DWORD on Windows.
You can use a library like boost to make it easier for you to write portable code. If you need a GUI consider using a cross platform toolkit like Qt.
Sometimes you will need to write platform specific code, and in those cases you can do something like this:
#ifdef _WIN32
#include
#else
#include
#endif