What is the use of ios::trunc mode?
Show answerHide answer
Correct answer: (C) To truncate an existing file to zero
Explanation
ios::trunc discards the contents of an existing file when it is opened, cutting its length to zero.
Correct answer: (C) To truncate an existing file to zero
Explanation
ios::trunc discards the contents of an existing file when it is opened, cutting its length to zero.
This is question 105 of BPSC TRE 1.0 (2023) Computer Science Class 11-12 — Previous Year Paper. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.