2001

Grusel++ of the month

Home
Download Source
/******************************************************************************/
/*                                                                            */
/*                                                         FILE: february.cpp */
/*                                                                            */
/*  A function try block, new in the standard                                 */
/*  =========================================                                 */
/*                                                                            */
/*  Compiled and tested with gcc version 2.95.3 19991030 (prerelease)         */
/*                                                                            */
/*  No microsoft compiler will compile this code, not even VC7.0 beta 1       */
/*                                                                            */
/*  V1.00   18-FEB-2001   P. Tellenbach   http://www.heimetli.ch/             */
/*                                                                            */
/******************************************************************************/

#include <iostream>
#include <cstdlib>

int main( )

try
{
    throw "Hello world !" ;

    return 0 ;
}
catch( const char *str )
{
    std::cout << str << std::endl ;

    exit( 0 ) ;
}

Update 23. February 2021

This program still compiles and runs without any changes.