I'm new to C.
I've split my sorting program into three .c files compare_functions.c
, insertion_sort.c
and main.c
, which includes the two.
In order to get the executable, I try the followings: (only related files in the current folder)
gcc -c insertion_sort.c compare_functions.c main.c
gcc *.o -o main.out
In addition to two headers compare_functions.h
, insertion_sort.h
, finally there are nine files in the folder, after ls
them:
compare_functions.c insertion_sort.c main.c
compare_functions.h insertion_sort.h main.o
compare_functions.o insertion_sort.o main.out
Finally the ./main.out
just work fine but, say, if I have a program much larger(ie. a hundred of .c file), finally there will be a mess with 100*3 files, is the way described above still suitable?