View Single Post
Old 05-09-2005, 12:02 AM   #1 (permalink)
deepak_kr_mehta
Guest
 
Posts: n/a
coding is not working

THIS FOLLOWING CODE IS NOT WORKING
Code:
#include<iostream.h>
#include<conio.h>
int main()
{
char ch;
fstream file("m.txt",ios::in|ios::ate|ios::out);
file.seekg(0);
while(file.eof()==0)
{
file.get(ch);
if(ch=='h')
ch='i';
}
file.seekg(0);
while(file.eof()==0)
{
file.get(ch);
cout<<ch;
}
return 0;
}
this code is for replacing the characters in the file named "m.txt" but it is not working and not showing any error.
plz solve this query
from
deepak kr.
  Reply With Quote