У меня вопрос по поводу заголовочных файлов в C++:
допустим, у нас есть строка
. I have read that this header file contains the function declarations for the math functions. However, why is it that when we compile a file with some math functions with inclusion of the header , it doesn't have any error? If the header file doesn't contain function definitions, then shouldn't we need to compile it together with the files for the function definitions in order for it to work?
On the other hand, when we have files on our own that have separate function definition and declaration, we need to compile the
files with the function definition file in order for it to compile.
Why is it that with header files like
and
, we don't need to do this?
Источник:
https://stackoverflow.com/questions/781 ... files-in-c