Comment Comment by ksherlock Take your pick:print("{:#04x}\n", 0xbeef);- or -cout << std::setw(4) << std::setfill('0') << std::hex << 0xbeef << std::endl; parent ksherlock 3 years ago
print("{:#04x}\n", 0xbeef);
- or -
cout << std::setw(4) << std::setfill('0') << std::hex << 0xbeef << std::endl;