Code: (Select All)
DIM a AS _BYTE
DIM b AS INTEGER
DIM c AS LONG
DIM d as _INTEGER64
DIM e as _FLOAT
DIM ends as _byte ' <-- should serve as the end
PRINT HEX$(_OFFSET(a))
PRINT HEX$(_OFFSET(b))
PRINT HEX$(_OFFSET(c))
PRINT HEX$(_OFFSET(d))
PRINT HEX$(_OFFSET(e))
PRINT HEX$(_OFFSET(ends))
The output shows you the memory addresses that are reserved for the variables.
Since they all follow each other in memory, you can view the addresses in a memory viewer.
QB64 actually reserves 8 bytes for each variable. Except for _FLOAT 32 bytes are reserved.
The wiki says nothing about how variables are reserved in memory.
It only says how many bytes are used.
Example:
A INTEGER used 2 bytes.
QB64 reserved 8 bytes for it in the memory.
The first 2 bytes of this reserved bytes are used. The rest remains unused.
This can be observed even via a memory viewer.