Hey everyone. Does anyone know how to create a 2D array that is greater than 1000x1000? I haven’t been able to do it in the Replit compiler without getting a segmentation error.
https://ss64.com/bash/ulimit.html
It’s the same issue as mentioned here. tldr adding a .replit
file containing this should work:
run="ulimit -s unlimited && g++-7 -std=c++17 -o main main.cpp && ./main"
Though I’m not familiar with Replit, maybe there’s a better way
I am unfortunately not familiar with implementing any of the solutions you have mentioned above. Do you know any substitute structures I can use for holding large amounts of data (other than 2D arrays)?
You could use std::vector
, but the docs I linked above are pretty clear on how to configure a Repl so I don’t see why you wouldn’t do that.