Here is some code for a data structure:
struct node {
char* command;
char** prereq;
prereq = malloc(100*sizeof(char*));
for (int i = 0; i<100; i++)
{
prereq[i]=malloc(80);
}
Node *next;
char *targ;
int isUpdated;
};
However, when I try to run the program with this structure in it, I'm getting this error:
error: expected specifier-qualifier-list before ‘prereq’
After reading up on this error, it looks like it's most common when someone tries to create a linked list without declaring 'struct' inside the structure. However, I'm baffled as to how it applies to my structure.
If it helps, I have this in the header:
typedef struct node Node;