Anthony AJ is completely right and has basically said it all.
I will add that C was designed from the start to be as platform independent as possible, which was a somewhat paradoxical goal given that it also enabled people to write "closer to the hardware." So, depending on how you wrote your code, you could write your programs to be as platform indendent... or platform DEPENDENT... as you wanted.
And C++ inherits most of C's traits, particularly with regard to data types...
Certain things in C (still in C++) are potential land mines. Particularly bad is the fact that "int" type is usually 16 bits wide on 16-bit systems, while it is 32 bits wide on 32-bit systems. This means that code running perfrectly well on 32-bit systems can "break" badly after being recompiled for 16 bit systems!
Someday we will even have 64-bit systems, and then the "int" type will be promoted to what is currently available as the "long long int" type -- usually 64 bits.
Consequently, you might want to avoid "int" type altogether and stick to "short" "long" and "long long int"... but even with those, be careful, because C++ spec does not absoltuely guarantee specific sizes. Oops! (Top secret advice: if you want to do what Microsoft and other companies do, define types such as "INT32" and "INT16" in header files, which you then carefully maintain for different platforms.... then use INT16, INT32, and INT64 as your primitive types. Avoid the standard types. That's if you want to be REALLY careful.)
My strong advice to you -- if you cannot avoid platform specific code -- is to "modularize" your program as much as possible (object orientation can sometimes help there, by the way) so that all the platform specific stuff (your I/O functions for example) is handled by just a few functions or classes. Then, write the rest of your program to be as platform independent as possible, so that you don't need to rewrite everything when you compile for a new system. Keep everything platform-dependent in just one module which you can rewrite as you need to.
Of course, you absolutely have to recompile for each new environment or platform! Each platform will have its own compiler or compilers created for it. In each case, the compiler's function is to translate the (relatively) more generic C++ code into machine code for that will run on that particular platform... and by "platform," remember, I refer to a particular processor type (thus different machine code), system architecture, and operating system.
Hope this helps,
== Brian Overland