M
Mathieu Malaterre
Hello,
I am trying to get rid a of sprintf in a c++ code, but I tried in
several ways and couldn't figure out how to change:
uint16_t group, uint16_t element;
sprintf(buffer, "%04x|%04x", group , element);
so far I have something like:
std:stringstream buf;
buf.flags ( std::ios_base::right |std::ios_base::hex );
buf.width( 4 );
buf << group;
buf << "|";
buf << std::hex << element;
std::string key = buf.str();
But doesn't seems to work...
Thanks for any help/pointer
Mathieu
I am trying to get rid a of sprintf in a c++ code, but I tried in
several ways and couldn't figure out how to change:
uint16_t group, uint16_t element;
sprintf(buffer, "%04x|%04x", group , element);
so far I have something like:
std:stringstream buf;
buf.flags ( std::ios_base::right |std::ios_base::hex );
buf.width( 4 );
buf << group;
buf << "|";
buf << std::hex << element;
std::string key = buf.str();
But doesn't seems to work...
Thanks for any help/pointer
Mathieu