首页 > 代码库 > c++ int to hex string

c++ int to hex string

#include <iostream>

#include <sstream>

int main() {

int i = 123;

std::string temp;

std::stringstream ss;

ss << std::hex << i;

ss >> temp;

std::cout << temp << std::endl;

return 0;

}


c++ int to hex string