How to check if std::hex is set

Mar 12, 2013 at 9:22pm
I have made a class named luint for handling very large unsigned integers. I want to overload the input and output operators std::ostream& operator<<(std::ostream&,const luint&) and
std::istream& operator>>(std::istream&,luint&).

I want to write such an implementation that if std::hex is set, my program displays the large integer in hexadecimal form instead of decimal form. How can I do this?
Last edited on Mar 12, 2013 at 9:22pm
Mar 12, 2013 at 9:48pm
1
2
3
4
if (stream.flags() & std::ios::hex)
{
	// "std::hex is set"
}
Topic archived. No new replies allowed.