I do not understand why I get this error. I tried google but i think that my code seems right... In main I have this:
Database *database;
database = (Database *)malloc(db_sizeOfStruct());
database->key = "word";
And in my module file I have this:
typedef struct database {
char key;
char value;
struct database *next;
} Database;
int db_sizeOfStruct() {
return sizeof(struct database);
}
The compiler gives "dereferencing pointer to incomplete type", why? I am trying to understand pointers, it's propably something about them I suppose...