Hi,
in C++ (on Linux with gcc) I'd like to put a byte array (vector<unsigned char>
) to a ostringstream
or a string
.
I know that I can use sprintf
but it doesn't seem to be the best way to use char*
also.
Edit: All answer work so far. But I did not meantion, that I'd like to convert the bytes/hex-values into their string representation, e.g., vector<..> = {0,1,2} -> string = "000102"
. Sorry for that missing but important detail