Given the availability of an ofstream object named output, write the other statements necessary to write the string “3.14159″ into a file called pi. (Do not define a main function.)

3
Given the availability of an ofstream object named output, write the other statements necessary to write the string “3.14159″ into a file called pi. (Do not define a main function.)

LANGUAGE: C++

CHALLENGE:

Given the availability of an ofstream object named output, write the other statements necessary to write the string “3.14159″ into a file called pi. (Do not define a main function.)

SOLUTION:



output.open("pi");
output << ""3.14159"";
output.close();

3 comments

Add comment