0

I am trying to declare the struct array but it show error. Error message: Unhandled exception at 0x013F28F9 in assignment 2.0.exe: 0xC00000FD: Stack overflow (parameters: 0x00000000, 0x004B2000).

#include <iostream>
#include <fstream>
#include<string>
using namespace std;

struct emp
{
    int empid;
    int dob;
    int height;
    int weight;
    int years_working;
    int salary;
    int allowance;
    char empname[50];
    char country[25];
    char designation[50];
    char gender[10];
    char education[15];
};


int main()
{ 
    emp employee[9999]; //declaration of struct array emp

    system("pause");
    return 0;
}
  • 4
    the stack is small, you are trying to allocate 1.8mb, use the heap – Alan Birtles Mar 08 '20 at 10:00
  • you got what's the name of this site: **stack overflow** and there are tons of duplicates [Is it possible to store 10 million numbers in array?](https://stackoverflow.com/q/22578879/995714), [Segmentation fault on large array sizes](https://stackoverflow.com/q/1847789/995714), [error while declaring double array of size 150000?](https://stackoverflow.com/q/16213358/995714) – phuclv Mar 08 '20 at 12:36

0 Answers0