Mail Archives: djgpp/1996/08/30/20:54:38
Ian Miller wrote:
>
> Should the C++ try-throw-catch mechanism work under DJGPP?
> Has anyone got it to work?
> Yes? Any chance of a snippet of source code?
>
> It's not documented in the gcc info, but gcc itself recognises
> the keywords and suggests compiling with the -fhandle-exceptions
> switch. I tried this, but the resulting program resolutely
> refuses to catch what I throw; it just calls terminate()
> every time.
>
> Thanks for any assistance,
> --
> Ian Miller, Dorset, AFRICA
> DJGPP 2.00, Win95 DOS box (LFN=n), 486DX4/100, 24Mbytes RAM
Hope this code will help you:
#include <iostream.h>
int main( int, char** )
{
try
{
throw 123;
}
catch( int k )
{
cout << k << " caught" << endl;
}
return 0;
}
--
Amit Ghosh
mailto:amit DOT ghosch AT hamburg DOT netsurf DOT de
- Raw text -