He2 I haven't learnt the operator precedence yet
but thanks to both of you! I've learnt two new things
I think my problem has solved..
He2 I haven't learnt the operator precedence yet
but thanks to both of you! I've learnt two new things
I think my problem has solved..
You might also have learned that, if you have a pointer to a struct, you can use two different ways to access its members:
In this case, the two following operations are the same:Code:struct myStruct{ int number; }; int main( void ) { struct myStruct *s = malloc(sizeof(struct myStruct)); }
In fact, the "->" operator has been introduced to automatically dereference a pointer to a struct to immediately access its members.Code:(*s).number; // or s->number;