I understand this is the C++ forum and to be honest posting here makes the most sense, but if I'm wrong I'm sorry.
Anyways, I'm trying to figure out if the compiler can handle the separation of header files and source files into different directories and how I would tell it that one is somewhere else. Or does it basically require both source and header file to be in the same directory?
Sources can be in different folders. It normally makes sense to have all new files belonging to a project in one branch so that you can work with relative paths. For headers of basic libraries you were using absolute paths (normally) or use the include environment variable.
The compiler gets the information where to search for header files by the -I option, e. g.