DEar All.
I am trying to read same file two times by calling a function as the following.
Code:
ifstream fmonju;
fmonju.open(monju.c_str());
if(!fmonju.is_open())
{
cout<< fmonju<< " can not be opened!!!! \n";
exit(1);
}
ofstream fmonju1;
fmonju1.open(monju1.c_str());
int cnt=6;
okuyaz(fmonju,fmonju1,cnt);
fmonju.seekg(0,ios::beg);
cnt=7;
okuyaz(fmonju,fmonju1,cnt);
In the okuyaz() function I am using
Code:
while(getline(fmonju,line))
{
//
}
when first time I call the function for cnt=6, it reads fmonju file. However in the second call for cnt=7, it doesn't read. This while loop doesn't work.
I will appreciate any help.
thank you!