Convert an ASCII std::string to hex

前端 未结 2 1671
暖寄归人
暖寄归人 2020-12-20 17:54

is there an easy way to convert an ASCII std::string to HEX? I don\'t want to convert it to a number, I only want to convert each ASCII character to it\'s HEX value. The out

2条回答
  •  爱一瞬间的悲伤
    2020-12-20 18:13

    This answer to another question does what you want, I think. You'd have to add a " " as separator argument for the ostream_iterator to get whitespaces between the characters.

提交回复
热议问题