Having some trouble with headers.
I have a header data.h
that contains the struct information for typedef struct newPerson
.
The data.h
is used in my source menu.c
. and in menu.c
, I have a function, void addStudentRecord(newPerson pers)
.
The code compiles and works like wanted.
However, I'm required to add all my functions to my menu.h
header. When I add void addStudentRecord(newPerson pers);
to my menu.h, I get this error unknown type name ‘newPerson’
.
I tried to solve this by adding #include "data.h
but that just gives me a shitload more errors. I was wondering how I would define a function that takes a struct in a header file?