Can you give an example of stack overflow in C++? Other than the recursive case:
void foo() { foo(); }
Here's one that might happen in practice:
int factorial(int x) { return x == 0 ? 1 : x * factorial(x-1); }
This overflows the stack for negative x. And, as Frank Krueger mentioned, also for too large x (but then int would overflow first).
x
int