I know that the following two things are the same in c (because of offsets and arrays)
someArray[i] //ith element of someArray
*(someArray + i) //ith element of someArray
However for structs, the same syntax doesn’t seem to hold up very well…
someStruct[i]->*(someArray + j) //compiler error
*(someStruct + i)->someArray[j] //Also compiler error
Is there anyway to use the pointer/offset notation (the second one) to represent elements of a struct?
Assuming
someStructis an array of structs, andsomeArrayis a struct member of array type, then either of these would be valid:or
See e.g. http://ideone.com/UtLN2.