Array: Difference between revisions
Content added Content deleted
m (→ReScript) |
Puppydrum64 (talk | contribs) m (→Assembly) |
||
Line 67: | Line 67: | ||
</lang> |
</lang> |
||
It is <b>much</b> easier to work with arrays in assembly if all rows are the same length. The best way to deal with a ragged or jagged array is to |
It is <b>much</b> easier to work with arrays in assembly if all rows are the same length. The best way to deal with a ragged or jagged array, such as an array of strings of different lengths, is to store ''pointers to the array entries rather than the intended entries themselves.'' This equalizes the size of all the elements of the array which makes it much easier to index. Another way to handle such arrays is with padding, by adding extra null bytes to the ends until all rows are the same length, but for many data types it's better to construct an array of pointers. |
||