Strange Error

I have a program that has been working but suddenly stopped. I can't post the code, except maybe in snippets, but hopefully you can tell me what's wrong.When I debug at runtime I get the message "An access violation (segmentation fault) raised in your program", a common debugging message. The highlighted line is in the header file "ios_base.h" at line 507.
flags() const { return _M_flags; }
Included files in my program are iostream and fstream. I have input and output files named "out20" and "out21" respectively.

When I try to delete either file from the OS, I get a message that says "The action can't be completed because the file is open in the command processor."
I suspect that this indicates what the problem is, and that there is no problem with my code.
I just feel like shanking myself now. My program randomly started working again, but I don't think I changed anything. Have any of you ever had something like this happen?

Also, for some reason it worked when I added this:
1
2
for (i = 0; i < size; i++)
    cout << current_node->deck[i] << ' ';

Can you think of ANY circumstances where a cout statement could prevent a runtime crash. This makes absolutely no sense to me, and makes me think there might be a bug in Dev-C++ causing this strange behavior. I wouldn't be surprised, considering how old it is.

Anyway, it works now with or without the cout statement.
Topic archived. No new replies allowed.