writing to mem using pointer

BlitzMax Forums/BlitzMax Beginners Area/writing to mem using pointer

Banks is one way of doing it, although I don't personally like that you have to specify a bank number in order to just poke or peek data.

You can just put [0] on the end of a byte pointer or other pointer to refer to the data at pointer+0 (or another offset).

e.g.

mypointer[0]=15 'write 15 into the address at mypointer.
mypointer[12]=15 'write 15 into the address at mypointer+12

But bear in mind it's 12 multiples of the size of the type of the pointer, so if its a byte pointer it'd be +12, if it's an int pointer its +12*4