I am doing a project for a class and need help breaking my program into separate parts. My teacher gave us a prompt that stated which files would do what, but he didn't tell us how to write the header files. From what I learned online, I put function prototypes in from each .c files in its own .h file and included them with "header.h" in the .c files. However, I am getting compilation errors such as
course1.c:20:3: warning: implicit declaration of function ‘initialize’ [-Wimplicit-function-declaration]
initialize(courses, subjects, CRN);
^
vector1.c:14:6: error: conflicting types for ‘resize’
void resize(char ***courses, char***subjects, int **CRN) {
^
In file included from vector1.c:2:0:
vector.h:11:6: note: previous declaration of ‘resize’ was here
void resize(char ***subjects, char ***courses, int **CRNs, int *size);
^
vector1.c:39:6: error: conflicting types for ‘deallocate’
void deallocate(char **courses, char**subjects, int *CRN) {
^
In file included from vector1.c:2:0:
vector.h:12:6: note: previous declaration of ‘deallocate’ was here
void deallocate(char **subjects, char **courses, int *CRNs, int size);
I am pretty sure my files have the right syntax because I compiled them separately into .o files and they worked fine. Can someone please state in general, how to break a program into separate files? I think I am obviously doing it wrong. One error the compiler gives me is that a function is not defined, when it is clearly defined in a header file I included.