C vs. C++ vs. ...
Posted Jul 4, 2012 12:52 UTC (Wed) by
jwakely (subscriber, #60262)
In reply to:
C vs. C++ vs. ... by nix
Parent article:
Why learn C? (O'Reilly Radar)
marked as extern "C" or something similar to indicate the impossibility of exceptions emanating from those points
extern "C" doesn't mean any such thing.
#include <stdio.h>
struct E { };
extern "C" void f();
int main()
{
try {
f();
} catch (const E&) {
puts("Caught");
}
}
extern "C" void f() { throw E(); }
(
Log in to post comments)