Advertisement

Error handling

Started by March 07, 2000 04:36 PM
2 comments, last by drago 24 years, 7 months ago
In many games when an error message pops up it contains the source file and line where the error occured, how is this done? Are they''re API functions that report that information? ---------- Drago
osu!
There are some predefined ANSI C macros that provide file name, line number etc. Look up the following in your compiler manual:

__FILE__
__LINE__

(Double underscores!)
Advertisement
I assume these macros work in Release mode (Visual C++ 6.0 SP3) aswell as Debug mode?

----------
Drago
osu!
They should, they don''t add any extra code to your program, so there are nothing to remove in the optimization between debug and release. They do add a constant though.

This topic is closed to new replies.

Advertisement