It’s a theorical doubt.
Suppouse you have a little library with just two files: lib.h. the headers from lib.cpp, the implementation code.
By convention, in C++ we include the lib.h in lib.cpp, that is, the lib.h “doesn’t know” about the “lib.cpp” existence.
So, to use our library in a program, suppouse: myprogram.cpp and myprogram.h, I have to include just the “lib.h”
So, how my program will load the implementation of headers? If the headers files “doesn’t know” about the implementations files existence?
It’s a theorical doubt. Suppouse you have a little library with just two files:
Share
Typically you compile the implementation into a library and link your program to that library. So, unless the implementation code is actually in the header, or in a file included by the header and therefore also distributed, your assertion that “implementation code exist just including header file” is false.