Array: Difference between revisions

m
Line 67:
</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, such as an array of strings of different lengths, is to padstore ''pointers to the endsarray ofentries eachrather shorterthan rowthe withintended arbitraryentries bytesthemselves.'' This letsequalizes youthe selectsize anof arbitraryall rowthe elements of the array which makes it much easier to index. Another way to handle such arrays is with apadding, simpleby bitadding shiftextra appliednull bytes to the indexends until all rows are the same length, but for many data types it's better to construct an array of pointers.
 
 
1,489

edits