nothrow new in cpp
int *p = new(nothrow) int; if (!p) { cout << "Memory allocation failed\n"; }
Source: www.geeksforgeeks.org
int *p = new(nothrow) int; if (!p) { cout << "Memory allocation failed\n"; }