Please can someone show me how would I create a file using fstream
that would take the contents from another existing file and user input sentence.
for example:
I have file1 with some contents
The user inputs a sentence
Now I want to create a file using streams that has contents of file1 and sentence.
My possible coding
ofstream output;
output.open("file2.txt");
output<<file1 + sentence<<endl;
output.close();
To me something in the code does not seem right.