Declaring a 2D array constant

How do you declare a 2D array constant? FOr example, if we know "that no map will be larger than 500 by 500". Thank you.
const and constexpr mean the data will not change. eg const int x[][] = {{1,2},{3,4}};
x[0][0] = 5; //error, data is constant.

array notation, int x[500][500] means the data can change, but not the dimensions (which means you can use *up to* those dimensions and track how much you used if you like).

I think you meant array notation, with a const max size?
Last edited on
Topic archived. No new replies allowed.