asked 76.1k views
5 votes
Given an ofstream object named output, associate it with a file named yearsummary.txt for output in a way that truncates (erases) any existing data in the file.

asked
User Yokasta
by
8.1k points

1 Answer

3 votes

Answer:

The answer is output.open("yearsummary.txt", ios::trunc)

Step-by-step explanation:

Given an ofstream object named output, associate it with a file named yearsummary.txt for output in a way that truncates (erases) any existing data in the file. The file is output.open("yearsummary.txt", ios::trunc)

answered
User Ekatef
by
7.3k points