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

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton