I just wonder if the file being read will also be read by the file which read it...but this doesn't sound logic, and i end out get confused. Maybe your deduction are right.
there're two processes involved: the compiler and the linker.
roughly:
the compiler is interested in the proper declaration of a symbol (size and for structures offset)
the linker resolves the symbols determined by the compiler so that the program may run
if you remove 'myclass.cpp' from your project the compiler doesn't care since he has all the informations he needs form 'myclass.h'. But the linker will complain about an 'unresolved external'
As far as the compiler is concerned, when compiling main.cpp it knows about the prototype of the function. It doesn't know anything about the function body at all.
That's the job of the linker. The linker is a separate program which runs after the compiler. Its job is to join everything together into a complete program. The input to the linker includes the object code previously generated from the two .cpp files, as well as the standard libraries as required.