#include int main() { try { std::cout << "hello world" << std::endl; } catch (std::bad_alloc const&) { std::cerr << "Out of memory." << std::endl; } }