Hello,
I'm sure this question is quite basic, so please forgive me if it is!
I am writing a function (call it "f()" and some supporting data types (structures, unions etc.) that will be used in various other files. I know I shouldn't put the definition of f() in a header file, as header files are only supposed to contain declarations and prototypes. So, should I declare f() in, say, f.h and define it in f.c? And - most basic of all - programs that use f(), should they
and, if so, how will they obtain access to the definition?
On a similar note, I often #include stdio.h, math.h etc. in my programs. When I look in the directory that contains these files (on my computer, "Microsoft Visual Studio/VC98/Lib" I find the header file but - again - where are the definitions? Are they in some DLL that gets pulled in at runtime? Is the purpose of the header file ONLY to facilitate compilation?
:-S
thanks,
dora c
I'm sure this question is quite basic, so please forgive me if it is!
I am writing a function (call it "f()" and some supporting data types (structures, unions etc.) that will be used in various other files. I know I shouldn't put the definition of f() in a header file, as header files are only supposed to contain declarations and prototypes. So, should I declare f() in, say, f.h and define it in f.c? And - most basic of all - programs that use f(), should they
Code:
include "f.h"
On a similar note, I often #include stdio.h, math.h etc. in my programs. When I look in the directory that contains these files (on my computer, "Microsoft Visual Studio/VC98/Lib" I find the header file but - again - where are the definitions? Are they in some DLL that gets pulled in at runtime? Is the purpose of the header file ONLY to facilitate compilation?
:-S
thanks,
dora c