Would this work?
BlitzMax Forums/BlitzMax Programming/Would this work?
| ||
In other words, any idea why this obviously silently crashes at memcopy(), as arr[0] doesnt get printed?Global arr :Byte[4] Global ivar :Int = 99999999999 Print ivar MemCopy( Varptr( arr ),Varptr( ivar ),4 ) Print arr[ 0 ] (edit: oh sry, found it out myself: it needs to be varptr( arr[0] )) |
| ||
Yah I was going to ask what you're trying to do, cus otherwise you were trying to copy the pointer to the array, not the first element of the array itself. |
| ||
Target is to read the color Parts of a grabPixel():Int out of a Byte array... works fine! |
| ||
Use 'arr' or 'Varptr(arr[0])' to get the address of an array. |