Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Memory-allocation/Nanoquery/memory-allocation.nanoquery
Normal file
17
Task/Memory-allocation/Nanoquery/memory-allocation.nanoquery
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import native
|
||||
|
||||
// allocate 26 bytes
|
||||
ptr = native.allocate(26)
|
||||
|
||||
// store the uppercase alphabet
|
||||
for i in range(0, 25)
|
||||
native.poke(ptr + i, ord("A") + i)
|
||||
end
|
||||
|
||||
// output the allocated memory
|
||||
for i in range(0, 25)
|
||||
print chr(native.peek(ptr + i))
|
||||
end
|
||||
|
||||
// free the allocated memory
|
||||
native.free(ptr)
|
||||
Loading…
Add table
Add a link
Reference in a new issue