Paste number 1959: funk C++

Paste number 1959: funk C++
Pasted by: brucehoult
4 years, 5 months ago
#dylan
Paste contents:
Raw Source | XML | Display As
#include <stdio.h>

struct foofoo {
    foofoo(){throw 13;};
};

struct foo : public foofoo {
    foo(int i);

    int bar;
};

foo::foo(int i)
try
    : bar(100/i + 10)
{
    printf("constructed foo(%d) with bar = %d\n", i, bar);
}
catch (...)
{
    printf("caught exception initializing with i=%d\n", i);
}

int main()
{
    try {
        foo myFoo(4);
        printf("in main, myFoo.bar = %d\n", myFoo.bar);
    }
    catch (...)
    {
        printf("in main's handler\n");
    }
    return 0;
}

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.