Surely __sizestring will return the sizeof the related string rather than the size of the array?
Surely __sizestring will return the sizeof the related string rather than the size of the array?
I'm pretty sure it gives the number of strings in the string array, not the length of any single string or the size in bytes. string is the name of the array of strings you are interested in. I bet if you changed that name of the string array to foo, you would have $int __sizefoo.
Sorry chaps but I still do not know what to fix to get my application to compile.
this does not compile
Code:dmmrp.c: In function ‘doUpdate’: dmmrp.c:90:63: error: ‘struct _ns1__GetMediaListResponse’ has no member named ‘GetMediaResult’ result = sprintf(Message, "%s\n", GetMediaListResponse.GetMediaResult->string[i]);
and if I use -> it also does not compile
Code:dmmrp.c: In function ‘doUpdate’: dmmrp.c:90:63: error: invalid type argument of ‘->’ (have ‘struct _ns1__GetMediaListResponse’) result = sprintf(Message, "%s\n", GetMediaListResponse->GetMediaResult->string[i]); ^
Last edited by straygrey; 10-31-2013 at 03:48 AM. Reason: Repeat previous to make message clearer
Umm...read your code more carefully. Look back at post #14. Your struct does not have a member GetMediaResult...it's called something else.
Switching between . and -> and vice-versa is not a magic "fix-all" for struct member issues. The only difference is that you use . with a struct and -> with a pointer-to-struct, when you are accessing members. If you don't have a pointer-to-struct, switching to -> will not fix anything, only introduce another error. You must learn what a pointer is, and when something is and is not a pointer if you want to have any chance of doing this program.
Thank you and sorry to be a pain.
It, of course, now compiles.
Last edited by straygrey; 10-31-2013 at 08:54 AM. Reason: Next step in the process