Addr
From Free Pascal wiki
Jump to navigationJump to search
│ Deutsch (de) │ English (en) │
addr
Determines the address of a variable.
Example:
var
i : integer;
p : pointer;
begin
i := 500;
p := Addr(i);
WriteLn(Integer(p^)) ;
WriteLn('"a" is at the following address:', PtrInt(p));
end.
Alternative
You can use @ instead of Addr(...).
The two examples below do the same thing.
p := Addr(i);
p := @i;
Where @ can also be used to determine the addresses of procedures and functions.
See also
simple data types |
|
---|---|
complex data types |