i have text file with a series of words in it. some word contain the expression '.zip' , i'm trying to rerad the characters of the file and replace the .'zip' with '.rar'
this is my prog, bu it's not responding
#include <iostream.h>
#include <fstream.h>
#include<stdlib.h>
#include<conio.h>
void main()
{
fstream f1;
f1.open ("student.txt", ios::in | ios:: out);
//f1 << "This is shit!";
int i=0;
static char str[100];
while (!f1.eof())
{
f1.getline(str,100);
f1<<str<<endl;
if (str[i]=='z')
{cout<<str[i+2];
if(str[i+1]=='i')
{if(str[i+2]=='p')
{
str[i]=='r';
str[i+1]='a';
str[i+2]='r';
}
}
}
i++;
}
f1.close();
}