I am reading a book called jumping into C++ and there is a part of the book that says this:
For example, a statement such as
#include <iostream>
tells the preprocessor to grab the text of the file iostream directly into the current file. Every time you include a header file it will literally be pasted into the file before the compiler sees it, and the #include directive will be removed.
So from this I understood that all of the files are pasted into one file so you are left with one source file. But then he went on to say this:
Each source file is separately compiled, meaning that the object file contains machine language only for the source code file that was compiled.
This suggests that the source files are still separate when it gets to the compiling stage but I thought that all the files had been pasted into one big file. Can someone explain, are all the files pasted into one file or are they left separate and later connected by the linker?