Merhaba <span style="color: #d4d4d4;">#include<iostream>
#include<fstream>
#include<string>
usingnamespacestd;

stringgetData()
{
string sData = "";
string line;
ifstream myfile ("example.txt");
if (myfile.is_open())
{
while ( getline (myfile,line) )
{
sData += line + "\n";
}
myfile.close();
}
else cout << "Unable to open file";
sData = sData.erase(sData.find_last_not_of("\n") + 1);
return sData;
}
voidprintData(stringdata)
{
ofstream myOutputfile;
myOutputfile.open("output.txt");
myOutputfile << data;
myOutputfile.close();
}
intmain ()
{
string sData = getData();
printData(sData);
return0;
}
[/CODE]</div>