jeudi 29 janvier 2015

Byte vector to hex stringstream DWORD aligned


Vote count:

0




I want to convert my bytes stored in a std::vector<unsigned char> to a stringstream DWORD (4 bytes) aligned.


Example:


content of byte vector: 0x12 0x00 0x1B 0xAC 0x15 0xDF (6 Bytes)



std::stringstream stream;
//stream << std::hex << std::setfill('0') << std::setw(8) ???


stream should look like: 12001BAC 000015DF


Is there an easy way with std::copy or how to implement this?



asked 2 mins ago

leon22

902






Byte vector to hex stringstream DWORD aligned

Aucun commentaire:

Enregistrer un commentaire