views:

106

answers:

1

Hi!

c++ with visual studio 2008

if i use assert() from assert.h and compile in debug mode, the application crashes if the assert condition doesn't hold and it prints me in the console on what line in what file this happened. that's quite useful, but i'd prefere to trap into the debugger at this position instead, if the condition doesn't hold

how can I do that? thanks!

A: 

Try running your program under a debugger. Also, if you have a JIT debugger registered with the OS, then this should actually invoke said debugger. If you are on a Windows machine, take a look at this MSDN article or this post.

nithins
I am running it under a debugger! i mean - i'm directly in Visual Studio working on the app - while debugging, however, if an assertion does not hold, there is a windows fatal error message instead of the debbuger halting
Mat