I have four files containing C code.
Headers.h – (contain all necessary) headers
AddStudent.h – that file include Headers.h also introduce some function delegation
AddStudent.c – contains functions described in AddStudent.h
main.c – contains main()
The question is how to compile the code with cc ?
In your case, your probably just need:
The right thing to do is make a makefile. Here’s a (probably a bit naive) example:
The best place to learn about
makeis the GNU Make Manual.Bonus note – if you’re starting to learn C, you might want to check out clang. It gives way better error messages than gcc does, in addition to supporting C99 without special flags and being much faster at compiling.