Original Post
I have a text stream for debugging, outputting to a file, initialized like this:
Used like this:
And closed like this:
Normally it works fine, but suddenly, it doesn''t - I haven''t touched it. When I comment out SetError''s only line of code and output text using the << operator instead of a function call, it works. Otherwise, it just shows a blank text file.
I am slowly but surely being driven insane by this problem. I''ve been debugging for two straight days, doing nothing else, and have absolutely no idea what''s going on.
Help. Please.
- TythosEternal
PS - The older versions of the same program, with identical lines of code for the stream and the SetError function, work fine.
"Who''s John Galt?"
remove("ErrorLog.txt");
//Removes old version of ErrorLog.txt
g_DebugText.open("ErrorLog.txt", ios::in | ios::out); //Creates a new text file for read/write
void SetError(char * String)
{
g_DebugText << String << endl;
}
g_DebugText.close();