RosettaCodeData/Task/Address-of-a-variable/PureBasic/address-of-a-variable-2.basic

8 lines
324 B
Plaintext

a.i = 5
*b.Integer = @a ;set *b equal to the address of variable a
*c.Integer = $A100 ;set *c to point at memory location $A100 (in hex)
MessageRequester("Address",Str(*b)) ;display the address being pointed at by *b
MessageRequester("Value",Str(*b\i)) ;de-reference the pointer *b to display the data being pointed at