www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/01/17:10:37

Message-ID: <37039DAC.9F3435FD@ox.ios.ac.cn>
Date: Fri, 02 Apr 1999 00:24:12 +0800
From: Yang <yanghh AT ox DOT ios DOT ac DOT cn>
X-Mailer: Mozilla 4.5 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: try, throw, and catch
References: <370121EB DOT 33506B4E AT jps DOT net>
Reply-To: djgpp AT delorie DOT com

One way to avoid this problem is using reference. 
     catch ( sorry& stuff )

btw, How to join the newsgroup of djgpp, where I can find the newsgroup
server for it?

Dennis Yelle wrote:
> 
> When I compile this program:
> 
> ---------- cut here for bug.cpp -------------------
> #include <iostream.h>
> #include <string.h>
> 
> struct sorry{
>     const char *error_msg;
>     sorry( const char *p) : error_msg(p) {}
> };
> 
> int main()
> {
>     try {
>         throw sorry( "test 3");
>     }
>     catch ( sorry stuff ) {
>         cerr << "Sorry, ";
>         cerr << stuff.error_msg ;
>         cerr << '\n';
>     }
>     cout << '\n';
> }
> ---------- cut here for bug.cpp -------------------
> 
> with gxx version 2.8.1
> using this:
>    gxx -g -Wall bug.cpp -o bug.exe
> I get this:
>   bug.cpp: In function `int main()':
>   bug.cpp:14: warning: value computed is not used
> 
> Can someone tell me which value is not used?
> 
> Dennis Yelle

- Raw text -


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