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

main.c

#include "otherStuff.h"

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

otherStuff.c

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

otherStuff.h

//function declaration
int myFunction();

You may also need include guards: