I've forgotten entirely, what does subscripting a pointer do in Pascal? p[0] 
returns 100 but after that garbage. Seems like a c-style array which doesn't 
feel right in the language.

var
  i: Integer;
  p: PInteger;
begin
        p := @i;
        p^ := 100;
        writeln(p[0]);
        writeln(p[1]);
        writeln(p[2]);

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to