Multiple choice

Which of the following file modes is used in file handling, if an already existing file is to be opened for output operations and its previous contents are to be deleted by a new one?

  1. ios::app

  2. ios::ate

  3. ios::binary

  4. ios::trunc

  5. ios::out

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

This file mode is used in file handling if an already existing file is to be opened for output operations and its previous contents are to be deleted by a new one.