|ARM Technical Support Knowledge Articles|
Applies to: C51 C Compiler
Information in this article applies to:
If I declare a structure called foo then declare a pointer to foo called foo_ptr I am then able to access members of the structure via the pointer using the '.' operator. For example:
foo_ptr = &foo; // initialize pointer to a structure foo_ptr->x = 3; // correct member accessing foo_ptr.x = 3; // this also works but it should generate an error
This is a known problem in C51 V5.x. It has been corrected in C51 V6.x (see below). If you still use C51 V5.x, care must be taken when accessing structures using pointers that the correct operator is used (->).
Article last edited on: 2000-03-05 00:00:00
Did you find this article helpful? Yes No
How can we improve this article?