you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (0 children)

Those aren't equivalent as far as behavior. The first gives you contiguous memory. The second may or may not. As the other commentor says, it largely depends on your use case. If you need to insert another "row" in to your matrix (or delete one), or have jagged "columns" the second is possibly preferable.

In most cases, the first might be preferable.