Pointer casting?

BlitzMax Forums/BlitzMax Programming/Pointer casting?

Who was John Galt?(Posted 2005) [#1]
Is there any way to cast say a byte ptr to an int ptr?


Who was John Galt?(Posted 2005) [#2]
Ah - found you can do it implicitly.

Local ip:Int Ptr
Local bp:Byte Ptr

i=256
ip=Varptr i
bp=ip
DebugLog ip[0]
DebugLog bp[0]
DebugLog bp[1]



Who was John Galt?(Posted 2005) [#3]
Damn - int to byte works (as above) but byte to int throws a compiler error. Can't this be done? If not, why not?

*Edit* - never mind - case of RTFM.