-
Notifications
You must be signed in to change notification settings - Fork 2
STL Buffer
TheRealMichaelWang edited this page Jun 30, 2021
·
1 revision
The code in this file implements utility procedures for collections/arrays. Many of these procedure's identifiers are quite akin to their C counterparts in both naming and functionality.
Type include "buffer.min" to include this library. If that isn't working, please make sure that:
- The unzipped contents of
stl.zipare placed in the working directory ofminima.exe. - Your version of minima is up to date.
include "buffer.min"
set array to alloc[100] rem allocates a new array with a capacity of 100
rem the code block bellow sets array to {99, 98, 97..., 0}
set i to extern len(100)
while dec i {
set array[i] to i
}
set array to goproc realloc(array, 200) rem expands the capacity of array to 200.
goproc memset(array, 0) rem sets all the elements in array to 0