Multiple choice

Which of the following steps is the first step to use files in C++?

  1. Declaring file streams

  2. Including the header files

  3. Opening a file

  4. Process the file

  5. Closing a file

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

This is the first step to use files in C++. To handle external files, header file like fstream.h has to be included in the beginning to perform input and output operations on files.