What compiler are you using? Not all compileres are built the same. Looks like the array is too big. It has to allocate 10000 char storage units on the stack for that to work. I'm betting there is some built-in or configurable option that limit the size.