hahahaha laser you are very funny..that even i know that eof has reached . Ok let me put my question in better way!
case 1:
Code:
#include"fstream.h"
int main(void)
{
ifstream f1("d:t1.txt");
char c[80],s;
clrscr();
cout<<"\n\nThe File Contains :\n";
while(f1) //loop for some reason doesn't work?? :(
{
f1.getline(c,80);
cout<<c;
}
return 0;
}
case 2:
Code:
#include"fstream.h"
int main(void)
{
ifstream f1("d:t1.txt");
char c[80],s;
clrscr();
cout<<"\n\nThe File Contains :\n";
while(fout.getline(c,80)) //This condition doesn't Work for string!But why??
{
cout<<c;
}
return 0;
}