C++20 sections · 1024 units
Open in CourseQuiz: Opening Files
Knowledge check
Check Your Understanding
What happens when you open an existing file with ofstream output("log.txt");?
- A.The file is opened in read-only mode
- B.The file is truncated to 0 bytes and opened for writing
- C.The file is opened in append mode, preserving old content
- D.An error occurs because the file already exists