Hi,
I'm working on a small project and i'm stuck in a part where I need to replace the existing word in file with a new one. I really have no idea about it.. I'm posting the function block where i'm facing the problem
void team::team_list()
{
string str = "(team)"; //existing word
string strTemp;
string tname; // to be placed in file
cout<<"\n\n"<<"\t\t\t"<<"Enter the team name: ";
cin.sync();
getline(cin,tname,'\n');
tname += ".doc";
fstream file(tname.c_str());
CopyFile("D:\\C++\\proj\\team.doc",tname.c_str(),TRUE);
file.close();
ifstream second(tname.c_str(), ios::in);
while(!second.eof())
{
if(strTemp == str) // I'm facing problem here
second<<tname;
}
dept_stud();
}
I hope I find the solution for this problem soon!!
thank You!!