You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
312 B
C++

A simple output manipulator: sethex
#include <iostream>
#include <iomanip>
using namespace std;
ostream &sethex(ostream &stream)
{
stream.setf(ios::showbase);
stream.setf(ios::hex, ios::basefield);
return stream;
}
int main()
{
cout << 256 << " " << sethex << 256;
return 0;
}