Vidyalelo
C++ Programming · Q39

File Handling in C++

Programming · C++ Programming · question 39

Q39

What is the purpose of the ios::trunc flag in C++ file handling?

A.
Truncates the file if it exists and opens it in write mode
Answer
B.
Opens the file in trunc mode
C.
Opens the file in read mode
D.
Opens the file in append mode

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board