|
From: <qa...@ho...> - 2003-10-09 21:47:50
|
1) I have no idea if the 'assert' function only should be compiled in=
debug-mode so I can't help you here.
2) When an assertion fails the program exits with an errorcode, this is the=
normal behaviour and as a result your window gets closed.
The only way I know of to work around this is to start the program from a=
dospromt, and not from within Dev-C++.
/J
*********** REPLY SEPARATOR ***********
On 2003-10-09 at 16:27 Wobien wrote:
>Using assert is supposed to be a big help in finding bugs in your program.
>
>#include <cassert>
>assert(a<b);
>
>should stop your program if a>=3Db and print the file and line number of=
the
>assert statement that failed, if and only if you run in debug mode. If you
>are not in debug mode, the assert statements should not be compiled.
>
>Now I have 2 problems:
>
>1: my program stops if the assert fails, even if I did not compile in the
>debug mode.
>
>2: when the program stops it does not wait and stop to give me the
>opportunity to read the message about the file and line number. The system
>("PAUSE"); statement at the end of the main procedure does not help here,
>because the program never gets there.
>
>A simple test "program" to try this is:
>
>#include <stdlib.h>
>#include <cassert>
>int main()
>{
> int a=3D5;
> int b=3D1;
> assert(a<b);
> system ("PAUSE");
> return 0;
>}
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: SF.net Giveback Program.
>SourceForge.net hosts over 70,000 Open Source Projects.
>See the people who have HELPED US provide better services:
>Click here: http://sourceforge.net/supporters.php
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|