ios or I/O Multiple Choice Question

G'day, I'm having difficulty on a particular practise question for an upcoming C++ exam and was wondering if anyone could help explain the answer to this one:


Question 31) The following program fragment:

1
2
3
  cout.setf(ios::showpos);
  cout.setf(ios::scientific);
  cout << 123 << " " << 123.23 << " ";


A) is an exaample of ios manipulators
B) is an example of ios class methods used in OOP for greater modulairty
C) is an example of formatted I/O using member functions of the ios class
D) is an example of I/O manipulators
E) this code fragment will not compile, not legal C++


I don't remember the lecturer ever going over this content this semester but everything in the practise exam is surely possible to come up in the real exam, can anyone give me a basic description of what these possible answers mean?

Cheers!
Last edited on
Use the search function on the top of the forum to look up ios::showpos; you will see that it is a manipulator and not valid for use with .setf().
Topic archived. No new replies allowed.