Hey guys, hope some of you will help with this problem i have.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
int main()
{
int ok=1,num=0,choice=1;
char inff[30];
string filen;
do
{
cout<<"Enter the name of the file with an extension (.bin)\n";
cin>>filen;
fstream f;
f.open(filen.c_str(),ios::out|ios::in|ios::binary);
num=f.fail();
so the num becomes = 1
i checked the eof() it is 0
i checked bad() it is 0
so i think the failbit is set.
what type of problem could it be.
also when i pass this object to any function ( even after using clear() )
the fail bit again becomes 1