This question assumes that the C/C++ code that is written is portable and does not use platform specific code.
I am beginning to learn C++ and how to compile code. I know that C was created to avoid assembly languages because programs would have to be rewritten for different hardware configurations. I also know that C/C++ has to be recompiled for different computer configurations.
That made me wonder what constitutes a new configuration. I can download an executable file from the internet that works just fine, and the internet obviously does not know my hardware configuration. Does code have to be compiled for each different CPU? Does code compiled for one OS version work for another one? (Does Windows 7 code work for Windows 8 without a recompilation?)
In a nutshell, what conditions define a new configuration that has to be compiled for?