
29 May
2008
29 May
'08
6:19 p.m.
I didn't see anything, but I may have missed something. Problem: Binary data is stored in a char buffer from a proprietary device: char* buffer = new char[6]; Data in buffer: [byte 1][byte 2][byte 3][byte 4][byte 5][byte 6] [---16 bit uint--][------------32 bit uint-------------] ...would like to convert to this in a C++'ish style using a boost facility if it exists: (or consider directing me somewhere else if it doesn't) struct // or class { boost::uint16_t first; boost::uint32_t second; } data; I would like to avoid a C-style way of doing this. This seems like something that would have been solved many times. thanks, graham