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

8 lines
324 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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