1

I'm very new to C++ and was trying to initialize a large 2d zero array. However, if I run this it gives no errors but "test a" is not printed. Anyone know what I'm doing wrong?

#include<iostream>

using namespace std;

int main(){
    cout << "test a" << endl;
    int arrone[60480][12] = {};
}
  • 1
    Your array takes 2.7 MB, you probably have stack overflow. – Yksisarvinen May 09 '21 at 16:05
  • Your huge array overflows stack and program crashes. Instead of plain array use heap-based `std::vector> arrone(60480);`, for this include `#include ` and `#include `. Then you can use it same like plain array, e.g. access `arrone[i][j]`. – Arty May 09 '21 at 16:19

0 Answers0