Why is ios not a class or namespace and why is fixed/showpoint subsequently undefined?

Mar 7, 2018 at 7:51pm


1
2
3
std::cout.setf(ios::fixed);
std::cout.setf(ios::showpoint);
std::cout.precision(2);
Last edited on Mar 7, 2018 at 7:52pm
Mar 7, 2018 at 7:57pm
You need to properly scope items from the std namespace, much like you did with std::cout.

std::cout.setf(std::ios::fixed);

Mar 7, 2018 at 8:00pm
ohhh, I did not realise ios was a part of std, I thought ios was it's own namespace.
Last edited on Mar 7, 2018 at 8:01pm
Topic archived. No new replies allowed.