1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <iostream.h> #include <stddef.h> #include <new> int fail = 1; static void *operator new(size_t size) throw (std::bad_alloc) { --fail; return (void*) 0; } int main() { cout << ""; new int; return fail; }