From: Andrew Holden (aholden_at_[hidden])
Date: 2006-12-18 09:18:12


Sebastian Redl wrote:
> Maarten Nieber wrote:
> > Sorry, I should have checked!
> > It should be:
> >
> > assert( 2 + 2 == 4 && "Adding numbers failed!" )
> >
> That still won't fire. The concept is flawed. You cannot use assert()s
> to print debug messages, because when an assert() prints a message, it
> also stops the program.

Actually, it will. The versions of assert that I have seen will print
the complete expression that failed before they stop the program. This
will include the string.