Is there any way in a C++ program to check if a declaration of a variable wouldn't have proper resources? There are times when such a check is important.
example:
int i = 0; would normally work, but if the system didn't have resources for it (RAM/etc), it will fail/segfault/etc.
int *i; would likewise fail under this scenario, so new I don't believe would be a solution.
exitor unwind the stack.intwill fail is when you run out of stack. This is basically a question about how to avoid that.exitwould be more-or-less apop()-type of command not requiring apush().atexit).