Return to Snippet

Revision: 958
at August 23, 2006 12:18 by yuconner


Initial Code
using namespace std;

int main()
{
    char *buf;
    try
    {
        buf = new char[512];
        if( buf == 0 )
            throw "Memory allocation failure!";
    }
    catch( char * str )
    {
        cout << "Exception raised: " << str << '\n';
    }
    // ...
    return 0;
}

Initial URL

                                

Initial Description

                                

Initial Title
try catch example

Initial Tags

                                

Initial Language
C++