C Programming Questions

Hey guys I am trying to put a bunch of functions into another .c file and and I also have a header file for that. I was wondering how I could take a .c file with a main method to #include that header file for those functions?

assuming files main.c, otherStuff.c, otherStuff.h are in the same folder
you can use this command to compile:
gcc *.c


#include "otherStuff.h"

int main(int argc, char** argv)
return 0;


//function implementation
int myFunction()
return 1+1;


//function declaration
int myFunction();

You may also need include guards: