Mega Code Archive
Categories
/
C++ Tutorial
/
Development
Create custom ostream operator
#include
#include
using namespace std; ostream &sethex(ostream &stream){ stream.setf(ios::showbase); stream.setf(ios::hex); return stream; } int main(void){ cout << 256 << " " << sethex << 256; }