YSI Wiki
Advertisement


Jagged_Resize

stock bool:Jagged_Resize(array[][], ...)
Parameters:
  • array
The 2D array whose slots are going to be changed in size..
  • ...
Multiple arrays containing a slot and the new size of that slot..
Notes:
This function changes the sizes of multiple slots in an array. This takes several ARRAYS of two slots each and changes the slot in the first index to the size given in the second index. Note that the final slot in the array will also (probably) get changed too as it takes up all the slack.
new
	arr[5][7]; // 5 * 7 = 35 cells total.
// "arr" currently contains 5 arrays of 7 cells each.
Jagged_Resize(arr, {2, 4}, {3, 8});
// "arr" now contains 2 arrays of 7 cells, 1 of 4, 1 of 8, and the final slot
// (4) has the remainder of the original 35 slots - i.e. 9 cells.

jaggedsizeof

jaggedsizeof (array[slot]))
Parameters:
  • array
The array to get the size of a slot of..
  • slot
The slot to get the size of..
Notes:
This is similar to using "sizeof (array[])" to get the size of the second dimension of a 2D array. However, as jagged arrays can have different sizes for different slots we need to specify WHICH slot we want the size of: "jaggedsizeof (array[2])".
Advertisement