Tips, Tricks and Tools
... and Thoughts
(Move to ...)
Home
All Posts
Firefox Extensions
JavaScript Compiler and Encoder
Bulk Player for YouTube
Misc Tools
Support
▼
Friday, June 21, 2019
C++: convert an integer to a hex string
#include <iostream>
#include <sstream>
#include <iomanip>
long i = 127;
std::ostringstream oss;
oss << "0x" << std::hex << std::uppercase << std::setfill('0') << std::setw(8) << i;
std::string result = oss.str();
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment