/* CSE 303, Spring 2009, Marty Stepp This program figures out the approximate size of the stack by repeatedly calling a function that declares a large stack-allocated array until it fails (the program will crash with a segfault). */ #include void f(int count); int main(void) { f(0); return 0; } void f(int count) { int a[1024 * 100 / sizeof(int)]; count += 100; printf("%d kb allocated\n", count); f(count); }