1.

Which of the following is not used as a file opening mode?(a) ios::trunc(b) ios::binary(c) ios::in(d) ios::ateI have been asked this question in an online interview.My doubt stems from File Handling topic in section Strings, Streams & Numerics in C++ of C++

Answer»

Right option is (a) ios::TRUNC

The EXPLANATION is: ios::trunc is USED to TRUNCATE a file if it exists. It is not a file opening mode.



Discussion

No Comment Found

Related InterviewSolutions