uses crt;
var z: char;
    s:string;
    p,q:^string; {ukazatele ^ odkazuje na konec "cesty" kam se retezec umistuje}

begin
repeat
clrscr;
writeln('Trtkal 2008 - http://fei.trtkal.net');
writeln('-----------------------------------');
begin
     s:='Ahoj';
     p:=@s;
     s:='Nazdar';
     p^:='cau lisi, jak se mate :D';
     {q^:=p^; program crashne :D memory leak ;)}
     new(q); {prirazeni nove pameti}
     q^:='Sbohem';
     writeln(q^);
     writeln(p^);
     dispose(q); {vraceni pameti - navraceni do rezie OS}
     {dispose(p); snazime se uvolnit statickou pamet, neni mozne}
end;
writeln('-----------------------------------');
write('Opakovat a/n: ');readln(z);
until (z='n');
end.
