We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
What I have is an array of unsigned chars the first byte is actually the number of elements in the array. So is it possible to have the compiler calculate the size of the array using sizeof()? or is there some other way?
#define MENU(ID) menu_##ID #define MENU_CNT_P(N) ((sizeof(MENU(N))-1)/sizeof(menu_position))
This of course gives 0 for the sizeof() value because the array isn't defined. Suggestions/thoughts welcome. Stephen
Jon, I see what you mean my example was from a case where a struct had to fit a Flash sector.
Erik