aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C++ Based Questions
  • Opening a file in ios::out mode also opens it in the ____...
Multiple choice

Opening a file in ios::out mode also opens it in the __________ mode by default.

  1. ios::app

  2. ios::in

  3. ios::trunc

  4. ios::nocreate

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

When a file is opened in ios::out mode, it is opened for writing. By default, this mode also includes ios::trunc, which clears the file contents if it already exists.

Keep practicing — related questions

  • Which of the following files modes is used to open a file for reading only?
  • Which of the following file opening modes shows error, if the file does not already exist?
  • If you want to open a file from initial position to the end of file, then which of the following modes is u...
  • Which of the following is not a file mode parameter used with open() function?
  • Which of the following file modes is used in file handling, if an already existing file is to be opened for...
  • Which of the following file modes is used in C++ if the user has to turn down opening when the file already...
  • The ____________ file mode is used in C++ to write all the data at the end of the file.
  • Which of the following is the default mode for a open() member function of fstream class?
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Computer File Systems (1249 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy