In my application I have a number of different structure variables. In all cases the members are unsigned char. I pass the structure to a function via a pointer where the various structures may have a different number of members with different names. Within the function I need to access the members in an indexed form. It is easy enough to use the first member to contain the size of the structure. If I used an array, indexing would be simple, but this would create problems down the line. Arrays aso have their problems - for example, strlen() returns a value of 0XFF if the array is uninitialised, as would be the case for an array that is to be written. I suppose I could always use an array to pass the data to/from the function and transfer between array and structure in the calling function, but that is hardly elegant programming!!!!
You could also just cast the structure pointer to an array pointer.
Oops. That should be "char pointer".