Answer:
The answer to this question can be given as:
code:
cout << "tweet:"; //print message.
getline(cin,tweet); //calling function getline.
output.open("mytweet"); //calling open by creating object of ofstream.
output << tweet;
output.close(); //close file.
Step-by-step explanation:
In the above c++ programming language code firstly we print the tweet variable as a message. Then we call the getline() function. In this function, we pass two variables that is cin and tweet. Then we create the object of the ofstream class that is output Then we open a file and call this file by output. In the next line, we use the output as a class function to print the value of the tweet variable. At the last, we close the file.