I got file1, need to read from file until the point, save to a char*, translate, delete from text the sentence discovered, and then repeat till EOF (end of file). Save to File2. Thank you,
//there is a sample of parsing cpp
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
int main()
{
ifstream xx("xx.txt"
string dx;
while(!xx.eof())
{
xx>>dx;
cout<<dx<<endl;
if(dx=="salut"cout<<"pa"<<endl;
else if(dx=="hello"cout<<"by"<<endl;
}
return 0;
}
//below is what xx.txt contain
salut hello bonjour hello
--------------------------
if you want to output in a file
ofstream resultfile("result.txt"
resultfile<<"pa"<<endl;
..... John Fill
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.