>>1
By itself, the c/c++ compiler is pretty dumb in that it has no way of knowing what functions are going to be used in your program. Additionally, it knows nothing about whether a function you've declared and used has even been defined yet, which is why you're able to simply put declarations in header files,
#include them and everything just works.
The compiler's job is to turn your source file into an ``object file'' which contains partial machine code and reference stubs whereever a function is used.
These object files are then given to a second program called a linker, whose job is to take a bunch of these object files, resolve all of those reference stubs into their real locations, and produce an executable binary.