#include <assert.h>
#include <iostream.h>
#include <setjmp.h>

jmp_buf env;

void f(int n)
    {
    // ...
    if (n < 3)
        longjmp(env, 1);
    // ...
    }

void g(int n)
    {
    float *a = new float[n];
    assert(a != 0);
    // ...
    f(n);
    // ...
    delete [] a;
    }

int main()
    {
    if (setjmp(env) != 0)
        {
        // recover from error ...
        }
    int n;
    cout << "n ?";
    cin >> n;
    g(n);
    return 0;
    }
