1.

Which of the following is the default mode of the opening using the fstream class?(a) ios::in(b) ios::out(c) ios::in|ios::out(d) ios::truncThis question was posed to me during an online interview.The origin of the question is File Handling topic in chapter Strings, Streams & Numerics in C++ of C++

Answer»

The CORRECT choice is (c) ios::in|ios::out

For explanation: By DEFAULT, the FILE is opened in ios::in|ios::out mode if the file object we are USING is of fstream CLASS.



Discussion

No Comment Found

Related InterviewSolutions