18 Dec
2006
18 Dec
'06
2:18 p.m.
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.