Given the availability of an ofstream object named output, and a string variable name tweet, write the other statements necessary to open a file named "mytweet", display the prompt tweet: and then read an entire line into tweet and then write it out to the file mytweet. (Do not define a main function.)
.
.
Click on the title for the solution
.
.
cout << "tweet:";
getline(cin,tweet);
output.open("mytweet");
output << tweet;
output.close();
.
Click on the title for the solution
.
.
This is the answer:
:
cout << "tweet:";
getline(cin,tweet);
output.open("mytweet");
output << tweet;
output.close();
Comments
Post a Comment