I declared and initialized an array having [100][1000][1000] char elements(100MB), it didn't say about a stack overflow at the first time.But when I running it after a while it throws a Stack overflow exception! I increased the -Stack Reserve Size- to 200,000,000 in project options->linker->system but it didn't worked! I'm working using 2GB Ram.How do i avoid stack over flow.
Is there a reason you need to allocate that much stack memory? This is likely a deficiency in your algorithm - not a deficiency with the compiler.
Default stack size isn't a linker option, but is controlled via a number of esoteric platform specific mechanisms.
On windows, this can be controlled when you call CreateThread. There are pthread attr mechanisms for doing this on Unix too.
In non-threaded code, on Unix there are ulimit settings that control this, but they can be restricted by platform limits. For example, on AIX in 32-bit processes stack and heap grow together in the second segment, so you have a max of 256Mb for both (and lots of fun once they hit).
There may be platform mechanisms that you can use to control this (like ulimit), but the suggestion to use the heap is likely prudent.