Dear all i used the following code to store data in array of structures (struct items item[]) but when the array size becomes > 5990 the program terminates unexpectedly. can you please explain why?
Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct items
{
char name[100];
char call_no[10];
char author[100];
char type[10];
char borrower[100];
int availability;
char due_date[8];
char genre[15];
};
int main()
{
struct items item[5500]; // program stops unexpectedly
char name[100];
char call_no[10];
char author[100];
char type[10];
char borrower[100];
int availability;
char due_date[8];
char genre[15];
printf("Enter the name of the item with _ for spaces\n");
fflush(stdin);
fgets(name,100,stdin);
printf("\n%s",name);
system("pause > null");
return 0;
}