C++ 2D Arrays vs 1D Arrays and 2D to 1D Mapping

Channel:
Subscribers:
2,640
Published on ● Video Link: https://www.youtube.com/watch?v=oVmLZ-jbehs



Duration: 54:12
249 views
4


1D arrays kinda suck, but they are a lot more usable than 2D arrays, so it is common to hold 2D data in a 1D array, and use "2D to 1D mapping" (i.e. algebra) to pull data from the 1D array as if it was a 2D array.

Or you could, you know, just refactor your code to use a vector instead.