C++20 sections · 1024 units
Open in Course

Quiz: Opening Files

Knowledge check

Check Your Understanding

What happens when you open an existing file with ofstream output("log.txt");?

  1. A.The file is opened in read-only mode
  2. B.The file is truncated to 0 bytes and opened for writing
  3. C.The file is opened in append mode, preserving old content
  4. D.An error occurs because the file already exists
Start the roadmap to answer the quizzes and solve the challenges