I'm using a makefile, but anyways this is my struct.h file
Code:
#ifndef struct
#define struct
typedef struct person{
char *name;
int socialNum;
char *dateOfBirth;
}person_t;
typedef struct flights{
char *flnum;
char *from;
char *to;
char *date;
float price;
person_t *fPerson;
}flights_t;
#endif
And this is my error from the terminal:
Code:
gcc -Wall -c bookAFlight.c
In file included from bookAFlight.h:7:0,
from bookAFlight.c:1:
struct.h:4:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
typedef struct person{
^
struct.h:8:2: warning: data definition has no type or storage class
}person_t;
^~~~~~~~
struct.h:8:2: warning: type defaults to ‘int’ in declaration of ‘person_t’ [-Wimplicit-int]
struct.h:10:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
typedef struct flights{
^
struct.h:17:2: warning: data definition has no type or storage class
}flights_t;
^~~~~~~~~
struct.h:17:2: warning: type defaults to ‘int’ in declaration of ‘flights_t’ [-Wimplicit-int]
Now I dont see whats wrong with my struct.h file tbh, if anyone can point it out.
Thanks.