Addr
From Lazarus wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
│ 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 |