Mail Archives: djgpp/1992/09/14/18:41:22
I.e., how big is the stack?
I wrote the following program:
main()
{
int fung;
loop:
printf("Enter value for fung: ");
scanf("%d",&fung);
printf("fung = %d\n",fung);
{
struct foo {
char *x[fung];
int y[fung];
} zeta;
printf("sizeof(struct foo) = %d\n",sizeof(struct foo));
printf("sizeof(zeta) = %d\n",sizeof(zeta));
}
goto loop;
}
And merrily entered values for fung. I tried -1 and it said the sizeof
was very big indeed. Now, this is all just screwing around, but I do
wonder just how much stack one is allowed to allocate...
And, what will happen if it is too big?
(Can anything bad happen?)
- Raw text -