0

I'm struggling with creating a large empty 2D array of strings (120000x7).

I created empty matrix like this:

string large_matrix[120000][7] = {};

If I create this array, it throws me a stack overflow exception. Does anyone know how to handle this problem? I do not want array as vector.

AxieKendy
  • 3
  • 2
  • 2
    `auto large_matrix = std::make_unique,7>,2000>();` This will prevent it from being created on the stack. And still be contiguous in memory (I assume you don't want vector because of non-locality) – Pepijn Kramer Dec 05 '22 at 12:09
  • Probable duplicate: https://stackoverflow.com/q/15803291/10871073 – Adrian Mole Dec 05 '22 at 12:10

0 Answers0