I've been having a persistent problem about something I really really don't understand:
I'm using the ifstream and ofstream objects to read to and write from files. They seem to work fine provided I declare the stream, do what I want with it and close it all in one block of code.
But when I pass the things by reference to other functions, they begin to act unpredictably. The program compiles and then is instantly closed by Windows, or it just hangs and stops responding. Oddly, it works perfectly when run in debug mode, but not when properly compiled.
This problem has recurred throughout many different projects and so I've not included any code. I'm assuming it's something to do with the internal code of ifstream/ofstream or some other factor about which I'm unaware.
Any ideas?



LinkBack URL
About LinkBacks


