What is the difference between fstream and ofstream in C++?
A. fstream can read and write, ofstream can only write
B. ofstream can read and write, fstream can only write
C. ofstream is used for text files, fstream is used for binary files
D. fstream is used for text files, ofstream is used for binary files
Answer: Option A
Related Questions on File Handling in C plus plus
Which header file is required for file handling in C++?
A. <iostream>
B. <fstream>
C. <file>
D. <filestream>

Join The Discussion