I am converting some code from SCO unix to Linux. the SCO code increments a structure with ((STRUCT_DEF *)variable)++;
gcc on Linux gives a lvalue error. I am assuming and would like confirmation if possible, that the replacement for linux would be.
variable = (STRUCT_DEF *)(variable + sizeof(STRUCT_DEF));
is this correct?
And then there is this:
SCO code: (STRUCT_DEF *) variable +=3;
is this adding 3 or 3 X size of sturcture?
Linux replacement would be?
variable = ((STRUCT_DEF *)variable)+3;
or
variable = (STRUCT_DEF *)(variable + (sizeof(STRUCT_DEF) * 3);
Thanks for any help.
Scott Hawley
scott@shawley.net