Вопрос

I want to know before I dump time into what might not be a viable coding method.

If I make a header file with a function somewhere in it, double fill(char *howtofill), can I then call the function inside the header file?

Это было полезно?

Решение

Usually in C, header files are used to declare function prototypes, which will then be included in proper C files (by the compiler). These prototypes make the C file code aware about functions, hardcoded in other C files, not in headers.

If you think you need to put code in a .h file, you probably have to think again about your program architecture.

Good to know: all your .h file content will be "copy-pasted" to the C file in place of the #include "file.h" directive. After the first step of the compiler (called preprocessing), your code will end in a single big file.

If this does not help you, can you tell us more about your problem ?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top