I'm having a problem understanding structs. I've created a struct (see code below) and then when I compile using MS Visual Studio I recieve a stack overflow problem. When I lower the number of items of the array to around 500, it compiles fine. What am I missing here? Thanks in advance.
#include <stdio.h>
#include <stdlib.h>
typedef struct {
char item[5];
float price[125];
} inventory;
void main()
{
inventory allitems[2000]; /* array of inventory structures */
printf("It Works!\n");
}
#include <stdio.h>
#include <stdlib.h>
typedef struct {
char item[5];
float price[125];
} inventory;
void main()
{
inventory allitems[2000]; /* array of inventory structures */
printf("It Works!\n");
}