The details of this process are vast and can be found if searched for on google!
Each C++ source file needs to be compiled into an object file. The first step that the compiler will do on a source file is run the preprocessor on it. Only source files are passed to the compiler (to preprocess and compile it).
For more information get help at
When we compile file it send a message to operating system a message 0 or 1,if compiler found program error free then it send message and return o to operating system and for error return 1.