Interprocess : offset_ptr used as array

16 May
2013
16 May
'13
11:44 a.m.
Hello, I have an offset_ptr named tmpData defined like this : offset_ptr<const byte>* someVariable; indextype index; ... offset_ptr<const byte> tmpData = ((offset_ptr<const byte>*)someVariable)[index]; data points actually to the beginning of an array. The original code, without shared memory was : byte* data= ((byte**)m_someVariable)[index]; The problem is that I have to translate that : indextype* data = (indextype*)&(tmpData[1]); The adress of the second element is taken though the & adress. But when tmpData is an offset_ptr, the [] operator returns a reference, and I can apply the & operator. Is there any solution that copying the pointer to temporary variable, and increment this one ? Thanks.
4301
Age (days ago)
4301
Last active (days ago)
0 comments
1 participants
participants (1)
-
Oodini