It might be because I don't pass the values correctly.Although the code is running.
#include <iostream>
#include <fstream>
#include <stream>
using namespace std;
int main()
{
//Files
ifstream Myfile;
Myfile.open("Myfile.dat");
ofstream ReverseEx;
ReverseEx.open("ReverseEx.txt");
string str;
//Getting the text from Myfile.dat and then passing it to Reverse.txt
while (Myfile>>str)
{
Myfile >> str;
reverse(str.begin(), str.end());
cout << "\n";
ReverseEx << str;
}
return 0;
}
//Input
//Hello everybody!!!
//STRINGS ARE COOL.
//Output
//!!! ydobyreve olleH
//.LOOC ERA SGNIRTS
The result should be like this example. But instead i got this
//!!!ydobyreveERA.LOOC