
30 May
2008
30 May
'08
11:17 a.m.
Scott McMurray
std::copy( binary_buffer.begin(), binary_buffer.end(), reinterpret_cast
(&dr) );
Or: memcpy(&dr, &buffer[0], buffer.size()); Or use union to avoid making a copy: union { data d; unsigned char bytes[4]; } u; bytes[0] = 3; bytes[1] = 6; bytes[2] = 0; bytes[3] = 9; // use d.first, d.second, d.third HTH, Roman Perepelitsa.