All pastes #902091 Raw Edit

main.cpp

public cpp v1 · immutable
·published 2008-02-13 03:56 UTC
rendered paste body
#include <iostream>#include <stdexcept>using std::cout;using std::endl;extern "C" void plain_c_function(void (*ptr)());void call2(){	throw std::runtime_error("Testing");}void call1(){	plain_c_function(&call2);}int main(int argc, char** argv){	cout << "Calling 1" << endl;	try {		call1();		cout << "Call 1 succeeded";	} catch(std::exception &e) {		cout << "Exception thrown: " << e.what();	}	return 0;}