Given an ofstream object named output, associate it with a file named yearsummary.txt by opening the file for writing.

1
Given an ofstream object named output, associate it with a file named yearsummary.txt by opening the file for writing.

LANGUAGE: C++

CHALLENGE:

Given an ofstream object named output, associate it with a file named yearsummary.txt by opening the file for writing.

SOLUTION:



output.open("yearsummary.txt");

One comment

  • Grant Sperry says:

    Given an ofstream object named output , associate it with a file named yearsummary.txt by opening the file for appending.

    output.open(“yearsummary.txt”,ios::app);

Add comment