Here is my code
it compiles
but nothing is replaced !!! nothing is written in the file !!! nothing happens to "new.txt"
Code:
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main()
{
string c,d = "";
fstream reads("R0_1st.txt",ios::in);
fstream writes("new.txt",ios::in|ios::out);
reads.unsetf(ios::skipws);
while ( getline ( reads, c ) ) {
cout<<c<<endl;
if ( c.find ( "Adiabatic Efficiency" ) != string::npos )
{
cout<<">>>>>>>>>>>>>>>"<<endl; //Just to make sure it got here
while( getline (writes,d) )
{
if ( d.find ("replace here") != string::npos )
{
cout<<"<<<<<<<<<<<<<<<"<<endl; //Just to make sure it got here
writes<<c;
}
}
}
}
return 0;
}