Logo

Programming-Idioms

History of Idiom 142 > diff from v26 to v27

Edit summary for version 27 by jdashg:
[Cpp] Add repl.it link

Version 26

2019-09-26, 20:02:40

Version 27

2019-09-26, 20:03:19

Idiom #142 Hexadecimal digits of an integer

Assign to string s the hexadecimal representation (base 16) of integer x.

E.g. 999 -> "3e7"

Idiom #142 Hexadecimal digits of an integer

Assign to string s the hexadecimal representation (base 16) of integer x.

E.g. 999 -> "3e7"

Extra Keywords
hex hexa radix
Extra Keywords
hex hexa radix
Imports
#include <sstream>
Imports
#include <sstream>
Code
std::ostringstream stream;
stream << std::hex << x;
s = stream.str();
Code
std::ostringstream stream;
stream << std::hex << x;
s = stream.str();
Demo URL
https://repl.it/repls/VariableMediumblueService