C++ array initialization error with global variable

0

I tried to run the following very simple block of code:

#include <iostream>
#include <bits/stdc++.h>

using namespace std;
int N = 1000027;

int main()
{
    cout << "Yes";
    int arr[N];
    cout << "Yes";

    return 0;
}

However, upon running the program only the first "Yes" text is getting printed, and I'm receiving the error message "Process returned -1073741571 (0xC00000FD)". What could be the issue here?

c++
arrays
initialization
global-variables
array-initialize
asked on Stack Overflow Jan 24, 2021 by d_sandor

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0