must be new!
If "constants.h" is in your default include path (i.e. in a folder with a bunch of other .h files) then you put
#include <constants.h>
at the top of your C program. The preprocessing fairy takes it from there.
If, however, "constants.h" is your own home-brewed creation and it's sitting in the same directory right next to main.c, you would change that first line of your C program to:
#include "constants.h"
which tells the preprocessor to look in the same directory as the C source file.
Another trick is to have the include statement point to the full path relative to the default include search path:
#include <subdirectory/my_includes/constants.h>
for those one-shot deals where it's not worth messing with changing your settings.
PS these tricks also work with including plain.C files.
|