delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/19/03:21:43

Message-ID: <19981219081705.17476.qmail@hotmail.com>
X-Originating-IP: [194.85.78.51]
From: "Serge Slepov" <sergeslepov AT hotmail DOT com>
To: djgpp AT delorie DOT com
Subject: does djgpp support exceptions?
Date: Sat, 19 Dec 1998 00:17:04 PST
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

To  : <djgpp AT delorie DOT com>
From: Serge Slepov <sergeslepov AT hotmail DOT com>
Subj: does djgpp support exceptions?


hi there,

my question is:  does djgpp support exceptions? (you know, try{} 
catch{}... )
I tried to run a simple example program but it seems not to catch the
exception at all, it only says `Abort!' and stops.

can someone help?

Serge



the code goes below.....

#include <stdio.h>

int main( int argc, char *argv[] )
{
    try
    {
        if( argc == 1 )
            throw "Insufficient no. of arguments. ";

        printf("No exception generated.\n");
        return 0;
    }
    catch( const char * msg )
    {
        printf("%s\n", msg );
        fflush(stdout);
    }

    printf("continue here after exception.\n" );
    return 1;
}



______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019