I\'ve perused the possible duplicates, however none of the answers there are sinking in.
tl;dr: How are source and header files related in C
? Do
The compiler itself has no specific "knowledge" of relationships between source files and header files. Those types of relationships are typically defined by project files (e.g., makefile, solution, etc.).
The given example appears as if it would compile correctly. You would need to compile both source files and then the linker would need both object files to produce the executable.