Which operator is used to combine two or more C++ file opening modes?

Options

  • A. Logical AND operator (&&)
  • B. Bitwise OR operator (|)
  • C. Assignment operator (=)
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. Bitwise OR operator (|)

Detailed Explanation

Correct Answer: Option B

Explanation:
The bitwise OR operator (|) combines file opening mode flags. For example, ios::in | ios::out requests both input and output access.