mardi 4 février 2020

Why we can't declare a large two dimensional array locally in c++?

When I declare table[1005][1005] inside a function and run the program it is stopped.

enter image description here

When I declare it globally it work. But what's the reason?

#include<stdio.h>
#include<string.h>

int table[1005][1005];

int main()
{
    printf("Hello there");
    return 0;
}

Aucun commentaire:

Enregistrer un commentaire