Char array to hex string C++

前端 未结 8 622
时光取名叫无心
时光取名叫无心 2020-12-05 06:42

I searched char* to hex string before but implementation I found adds some non-existent garbage at the end of hex string. I receive pa

8条回答
  •  渐次进展
    2020-12-05 07:41

    Supposing data is a char*. Working example using std::hex:

    for(int i=0; i

    Or if you want to keep it all in a string:

    std::stringstream ss;
    for(int i=0; i

提交回复
热议问题