I am just trying to initialize a huge array. My code is given below:
#include<iostream>
using namespace std;
int main()
{
int T;
cin >> T;
while (T--)
{
int d;
cin >> d;
int arr[d + 1];
for (int i = 0; i <= d; i++)
arr[i] = 0;
}
return 0;
}
Now when I input
1 502334160
then I got error Runtime Error - SIGSEGV
.
I want to know how to initialize this type of array.