How do I make this struct instruction visible to struct cpu state? Like If I put cpu state struct first it doesn't work because some other arguments won't be visible to struct instruction but if I put it reverse again I have a problem.
struct cpu_state
{
int nextinstructionlinenumber;
char filename[200];
char RLO;
struct instruction instructionlist[INSTRUCTIONLIST_SIZE];
int instructionlistnumber;
struct variable variablelist[INSTRUCTIONLIST_SIZE];
int variablelistnumber;
};
struct cpu_state CPU;
struct instruction{
char name[LINE_CHAR_NUM];
void(*function)(struct cpu_state* pstate, struct line* pline);
};
struct instruction instructionlist[INSTRUCTIONLIST_SIZE];to succeed, the compiler must at least know the size of the struct, so it must know its definition at this point.