CS253: Software Development with C++

Fall 2018

IQ 10

CS253 IQ 10

See this page as a slide show

ios state flags

When an fstream open fails (explicitly, or via ctor), which bit is set?

  1. ios::failbit
  2. ios::eofbit
  3. ios::badbit
  4. ios::openbit
  5. None of the above

ios state flags

When a conversion fails, which bit is set?

  1. ios::failbit
  2. ios::eofbit
  3. ios::badbit
  4. ios::convbit
  5. None of the above

ios state flags

When you read the fifth byte of a five-byte file, which bit is set?

  1. ios::failbit
  2. ios::eofbit
  3. ios::badbit
  4. ios::lastbit
  5. None of the above

Rule of Three

Which three are mentioned in the Rule of Three?

  1. default ctor, copy ctor, assignment, dtor
  2. copy ctor, assignment, dtor
  3. default ctor, assignment, dtor
  4. default ctor, copy ctor, dtor
  5. default ctor, copy ctor, assignment

methods

How do I get rid of the implicitly-provided assignment operator?

  1. Foo &operator=(const Foo &) = 0;
  2. Foo &operator=(const Foo &) = delete;
  3. Foo &operator=(const Foo &) const;
  4. delete Foo &operator=(const Foo &);
  5. Simply don’t write one.

User: Guest

Check: HTML CSS
Edit History Source

Modified: 2018-10-23T21:13

Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2018 Colorado State University
CS Building