Hi, I am learning manipulators, and I have a few questions about when to use ios::. I understand I need to use this for the manipulator to have access to its 'base' but in certain examples in my book it is not used, and i dont understand why it is not used in these examples. I have shows all the examples below. If anyone could explain, it would be appreciated.
The "showpoint" is for printing decimal values of "1.0", but I have found that when "setprecision" has a value greater than (0) it will always print ".0" because "setprecision" says to print at least 1 decimal place.
I do not know if there is a better time to use "std::ios::something" over the above code or not. What I have done is usually simple and the above code works just fine.
It may come down to how much do you want to type and how much checking you want to do when you do not remember the correct syntax.
<< 123 << " " << 123.23; //setioflags does not need ios:: but scientific does