
11 Oct
2007
11 Oct
'07
6:40 a.m.
I am searching for a library / component / pattern that will help me with the following problem: I have a memory structure in raw memory (received from a measurement instrument), that is unaligned in its data members. Now I want to have an access interface to this data that comes as close as possible to access of a struct. E.g. struct foo { char a; int b; } Altough my raw data "char* pdata" has an 8bit followed by a 32bit I want to be able to do something like: foo data(pdata); and then char ch = data.a; int n = data.b; Does anyone know about such a library? (This should work compiler/platform independent of course.) Thank you, Roland aka speedsnail