1.

What is the use of ios::trunc mode?(a) To open a file in input mode(b) To open a file in output mode(c) To truncate an existing file to half(d) To truncate an existing file to zeroThis question was posed to me in an internship interview.I'm obligated to ask this question of File Handling topic in section Strings, Streams & Numerics in C++ of C++

Answer»

Right option is (d) To TRUNCATE an existing FILE to ZERO

Easy explanation - In C++ file HANDLING, IOS::trunc mode is used to truncate an existing file to zero length.



Discussion

No Comment Found

Related InterviewSolutions