So, I have the following .h files: StudentRosterDef.h and StudentRoster.h
StudentRosterDef.h:
typedef struct Node *NodeP;
typedef struct Student *StudentP;
StudentRoster.h:
typedef struct StudentRoster *StudentRosterP;
//Below prototype creates empty studentroster and returns a NULL pointer
StudentRosterP newStudentRoster();
Now, I have the following .c file to accompany : StudentRoster.c
StudentRoster.c:
#include "StudentRosterDef.h"
#include "StudentRoster.h"
struct StudentRosterP
{
NodeP root;
};
struct NodeP
{
StudentP left;
StudentP right;
};
StudentRosterP newStudentRoster()
{
StudentRosterP thisRoster = (StudentRosterP) malloc(sizeof(StudentRosterP));
thisRoster->root = 0x00;
thisRoster = 0x00;
return thisRoster;
};
Here is the message I get after running the gcc command on the terminal:
StudentRoster.c:27:12 : error: incomplete definition type of 'struct StudentRoster'
thisRoster->root = 0x00;
~~~~~~~~^
./StudentRoster.h:14:16: note: forward declaration of 'struct StudentRoster'
typedef struct StudentRoster *StudentRosterP;
^
1 error generated.
The StudentRoster.h file can not be changed or modified in anyway as it is a supplied file and the .c and other accompanying .h files must be built to fit the description of StudentRoster.h exactly. Thanks for any help in advance!