🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: File Handling in C++: all 10 questions

Quiz: File Handling in C++ · Question 1 of 10

Which class do you use to read data from a file?

Which class do you use to read data from a file?

  1. A.ofstream
  2. B.ifstream
  3. C.ostream
  4. D.iostream only
Answer & explanation

Correct answer: ifstream

ifstream is the input file stream, the file version of cin.

Can you get the rest right without peeking?

Take the timed Quiz: File Handling in C++ quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →