adsci wrote:
> Hello there!
>
> ive got a question which can be surely answered easily, but i dont know
> the answer.
>
> If you allocate memory by new/delete on the heap theres always the
> possibility that the allocation failes and your programm dies horribly
> if you dont check for failed allocations (try/catch or new == NULL). okay.
>
> but whats with stack variables?
> even an
>
> int i;
>
> should fail if there are not sizeof(int) bytes available.
> even more a
> int intarray[99999999999];
>
> what actually happens if thats the case? how can you check for that?
>
> Thank You Very Much! and forgive me my newbie question ;(
What actually happens is your program dies a horrible death
And, you can't check for that. It is a design error. There should be
guidance available on how much stack space is available, and in some
cases you can even define your program's stack size requirement (in
various platform-specific ways).
--
Scott McPhillips [VC++ MVP]