I have an excersise, where i have to read text from a text file in read mode and the copy that text to another text file in write mode, so far its all ok with reading the file, but stuck on placing that output in another.
#include<iostream>
#include<fstream>
#include<cctype>
usingnamespace std;
int main()
{
fstream mans;
fstream mans2;
char c;
mans.open("my_file.txt", ios::in);
mans2.open("my_file2.txt", ios::out);
mans.get(c); //reading first file
while (mans)
{
cout<<c;
mans.get(c);
};
//need to place the text from my_file.txt to my_file2.txt besides in uppercase.
mans.close();
mans2.close();
//check, if the text is placed into other file
char a;
mans2.open("my_file2.txt", ios::in);
mans2.get(a);
while (mans2)
{
cout<<a;
mans.get(a);
};
mans2.close();
system("pause");
return 0;
}