delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/13/19:45:45

Message-ID: <35D15062.B4DC35DB@megalink.net>
From: Chris Bill <chrisb AT megalink DOT net>
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: try, throw, and catch woes
Lines: 26
Date: Wed, 12 Aug 1998 08:20:50 +0000
NNTP-Posting-Host: 208.148.249.218
NNTP-Posting-Date: Wed, 12 Aug 1998 04:16:46 EDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Can someone please tell me what is wrong with this code?
(Using GCC 2.8.1 w/DJGPP 2.x):

#include <iostream.h>

int main( )
{
    try {
        throw 10;
    } catch( int num ) {
        cout << "Nifty... cought: " << num << endl;
    }

    return 1;
}

Whenever I run the resultant executable, my computer reboots (before
printing the message)!

Thankfully, the reboot is from Win95 to Linux... maybe DJGPP is trying
to tell me something :)

Regards,
Chris Bill


- Raw text -


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