Header files don't contain any algorithms themselves, they would only contain declarations, typedefs, global variables, etc.
So where do you put the algorithms themselves? you keep them in another .c file, which must be compiled and linked to your main file.
e.g. Lets say we have a function WriteUsage() that we want to place in a separate file and add it using a header file. We'll have 2 extra files (of course the file names are just examples):
Now, writeusage.c will contain the function body, and will look something like this:
writeuser.h will look like this:
#include "writeusage.h" //You don't need to include this header, however it is preferable since you can keep all the standard headers you need inside it
printf("usage: program filename options\n");
Your main file will look like something like this:
Now when you want to compile it, you'll need to inform the compiler to compile wrtieusage.c, and the linker to link its object file to your program like this:
int main(int argc, char *argv)
if (something's wrong with the arguments)
do whatever you want
gcc main.c writeusage.c