#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXNO 1000
typedef struct
{
int n;
char site[4];
} stru;
typedef struct
{
stru t1[MAXNO];
stru t2[MAXNO];
} struall;
int main()
{
struall tmp;
int i;
printf("%d\n",i);
return 1;
}
Hi everyone, I am trying to declare a structure variable which has two structure array members inside it. If the array size (MAXNO) is small, i can compile successfully. However, if the array size is very large (define MAXNO as 1000000), the declaration fails with segmentation fault.
Can anyone tell me the reason?
Thanks a lot!