fopen = assert error?

Started by
3 comments, last by Andrew Russell 18 years, 10 months ago
Using Visual C++ .NET 2003. Whenever I try to use the fopen functions, it thorows an exception error. I can't find anything on MSDN telling me of some change in the way fopen works in 2003, so do any of you know anything?
L.I.G. == Life Is Good
Advertisement
assert or exception? the two are very different.

fopen will assert on a missing file in debug mode - you can safely ignore it and continue execution - things will work as expected.
It's assert.

So fopen asserts with a missing file in debug mode huh? Thanks for the info. I never knew that before.
L.I.G. == Life Is Good
Isn't assert only supposed to be used to test for impossible conditions? Missing files seem pretty possible to me.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
Yes, but in this case they're using it for a general "alert the programmer of possible badness" - which is a possible use. Although I wouldn't do it that way myself, it does indicate to bad programmers who don't check their file is valid what went wrong.

This topic is closed to new replies.

Advertisement