Why not just allocate a single array and treat it as a x*y space.
for every y spaces is a new x row
Less initializing time spent doing separate allocations, for every new row. Particularly if this code is only for small 2D arrays; for larger amounts of data and more involved code, you'll need to write a container or look into the ones C++ provides(ie. vector, map, stack, string(for all char types), et al.).
Reputation Points: 888
Solved Threads: 114
Nearly a Posting Virtuoso
Offline 1,270 posts
since Nov 2008