I don't quite understand how the main.cpp knows to use class definitions and function definitions from a header's source file.
I understand how #include HeaderName.h
is able to include class declarations, because we tell main.cpp to include it. However, not in the header file nor main.cpp is the program told to get the class and function definitions from the HeaderSource.cpp
. So, how does it know that the definitions for the declared classes are in there?