Hi
Basically i am trying to read a file and insert a specific string at a position. but it seems that the entire process freezes and the program runs out of control.
fstream shot;
char mess[240];
shot.open("file.vix");
while(!shot.eof())
{
shot.getline("mess",240);
if(strcmp(mess,"<DEPT>)==0)
{
shot<<"< ANNOUNCED >\n"; //TROUBLE
}
}
the code works fine until it encounters the <DEPT> tag and it comes to the next line. but at that position when i try to write the "< ANNOUNCED > "tag the program simply goes into a loop.
wont read anything, wont write anything, wont detect the end of file. the while loop simply goes on without any other reaction.
I HAVE CONFIRMED THIS BY GIVING COMMENT OUT PUT TO SEE THE
LOCATION OF CODE THAT IS RUNNING.
as this problem is not anything i can handle with the knowledge i have i am posting it here. please help me with this.
this is a verry important assignment , and i have to get it ready pretty soon.