среда, 2 февраля 2011 г.

Getmem, Freemem, Pointer math

YAR language is enhanced by supporting Getmem, Freemem and pointer math.
Sample

program myprogram;

procedure dosample();
p:pointer;
pinteger:^integer;
i:integer;
begin
GetMem(p,400);
pinteger:=p;
for i:=0 to 99 do pinteger[i]^:=i;
for i:=0 to 99 do write pinteger[i]^;
FreeMem(p);
end;

begin
dosample();
end

Комментариев нет: