-
Notifications
You must be signed in to change notification settings - Fork 3
Packages
Amukh1 edited this page May 3, 2023
·
10 revisions
print("hello ");
print("world");
hello world
println("hello");
println("world");
hello
world
printstr("hello");
printstr("world");
hello
world
Definition:
var vector = size;
var& vp = vector;
pushes value top of array
push_back(vp, value);
sets value of array at index
set(vp, index, value);
retrieves a value of array at index
var valie = retr(vp, index);
allocates n bytes of memory in the heap, returns a pointer
var a = alloc(4);
a is a pointer to the 4 bytes (dword) stored in the heap.
puts a value in allocated space, given a pointer
var a = alloc(4);
malloc(a, "hi!");
var* ap = a;
printstr(ap, 3);
hi!
clears memory in allocated space
var a = alloc(4);
malloc(a, "hi!");
var* ap = a;
printstr(ap, 3);
free(a);
var* ap = a;
printstr(ap, 3);
hi!