Hey all, a small problem:
If I have a basic structure declared as follows:
How do I find the length of a member of mystruct without first declaring it etc?Code:struct mystruct { int item1; int item2; char name1[CONST_SIZE]; };
i.e. something like:
Code:int nsize1 = sizeof(mystruct.item1); // Like this int nsize2 = sizeof(mystruct.name1); // Or this // Instead of: mystruct mys; int nsize3 = sizeof(mys.item1); int nsize4 = sizeof(mys.name1);
Cheers for any help, it will be much appreciated