Static C Libraries
Why use static C libararies?
Libraries are faster alternatives to a usual header and functions seperated by files. They make it easier to compile functions since it speeds up the overall linking proccess due to the system not needing to open and close each individual file like it normall would. It is also easier to access accross you system overall creating a larger scope for your functions.
How do they work?
C static libararies work by placing object files for your functions all in one place for the compiler to use during the linking proccess through indexing of each function.
How to create them?
Step 1: create a C file with your function
Step 2: create a header file with you prototype function
Step 3: create a object file using gcc -c file_name.c
Step 4: use the ar rc command to make you library
How to use them?
In order to use you new library in a function you have to compile a object file of you C program using ( gcc <file_name.o> -l )
Make sure you have your header file included in you program head !