Sign in Join
Wiki copytemporary

Revision 1 of 1, by Trev on 1-19-2020. The page as it is now.

Addr/de

Addr

Ermittelt die Adresse einer Variablen.

Beispiel

pascal
var
  i: Integer;
  p: Pointer;
begin
  i := 500;
  p := Addr(i);

  WriteLn(Integer(p^));
  WriteLn('"a" befindet sich an folgender Adresse: ', PtrInt(p));
end.

Alternative Schreibweise

Anstelle von Addr(..) kann man auch ein @ nehmen.

Folgendes macht das Gleiche.

pascal
  p := Addr(i);
  p := @i;

Wobei man mit @ auch Adressen von Prozeduren und Funktionen ermitteln kann.

Siehe auch

Pointer

Autor: Mathias


From the Free Pascal wiki, page "Addr/de", as it stood on 2020-01-19 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.