Without using recursion how can a stack overflow exception be thrown?
If you're talking about C++ with a reasonable standard library, I image that this would work:
while (true) { alloca(1024 * 1024); // arbitrary - 1M per iteration. }
Details on alloca.