Hi all, For some reason, I cannot access the structure members if I use struct pointers.
eg:
typedef struct { int member1; }structure_t;
structure_t structure, *structure_ptr;
int main() { sturcture.member1 = 4; //works structure_ptr -> member1 = 4; //does not work
return 0; }
I am using KEIL MDK 5.23 with TM4C123GH6PM. I am using the debugger to see if the member values are changed or not.
What am I missing?
Thanks, EE
have the warning level set high enough that the compiler will tell you about such silly mistakes
Would you please teach me how to do that? I tried on Keil and CodeBlocks, but no success.
typedef struct { int member1; } structure_t; structure_t structure, *structure_ptr; int main() { structure.member1 = 4; structure_ptr->member1 = 8; return 0; }