I've always been curious: in VS, and most other IDEs, you are allowed to do something like this:
//in file class.h
class blah {
//prototypes, members, blah, blah blah
}
//in file class.cpp
#include "class.h"
//method definitions... etc.
//in file main.cpp
#include "class.h"
int main
{
//do stuff with the class
return 0;
}
so, how exactly does that work?
I assumed originally that it was some awesome thing that C++ compilers did, but, after testing with Geany on Ubuntu, I have to include the cpp file, not the header, or it won't find the method definitions. So, is this just based on the way VS builds projects (all files at once), or, is there something it does behind the scenes to make the above code possible?