c - Expected expression before error -
i've been working on project while , wanted test it, keep getting error , have no idea , confused. here code:
typedef struct{ int nr_pages; int id; int a,b; int aux; }information; int main(){ int i; = information.b; //and more stuff happens }
the error getting "expected expression before 'information'" declare = information.b doing wrong?
you need instantiate structure before using it. try:
typedef struct{ int nr_pages; int id; int a,b; int aux; }information; int main(){ information info; info.b = 0; info.a = 0; ... etc ... int = information.b; //and more stuff happens }
Comments
Post a Comment