Initializing 2D Vector?
I wonder how can I a initialize a 255x255 Square Matrix ?
I thought that Using a Vector should be the easy approach, but how can I initialize them?
and offcourse when I do something like matrix[j][i] = 123;
Vector < Vector <int> > matrix2d; //this should be initialized as 255x255 2D vector
I get a EXEC_BAD_ADDRESS!.
Any help is very appreciated!
It should be something like this:
std::vector<std::vector<int> > matrix2d(255, std::vector<int>(255));