Need some help w/fstreams and C++

tfinch2

Lifer
Feb 3, 2004
22,114
1
0
Close your do/while loop

I don't know if this will fix anything, but it's still an error.
 

purbeast0

No Lifer
Sep 13, 2001
53,639
6,522
126
Originally posted by: tfinch2
Close your do/while loop

I don't know if this will fix anything, but it's still an error.

Yah that's an error that I erased in my code clip when trying to format it in the attach code thing.

But in my code it's there. It's not a compile error either, its a runtime error.
 

Cerebus451

Golden Member
Nov 30, 2000
1,425
0
76
When the first attempt at an open fails, the failbit is getting set, and it appears to remain set even after the subsequent open succeeds. The input operations must then be checking the failbit and just not doing anything if set. You can add a inStream.clear() call as part of your if check to clear the failbit before the next attempt at open.

EDIT: Too late :p