hi
look at this example , the procedure changestr works only if the argument is ppchar , and not for pchar
uses strings;
type
ppchar = ^pchar;
procedure changestr(s : ppchar);
begin
getMem(s^,16);
strcopy(s^,'Hello World');
end;
var
p : pchar;
begin
changestr(@p);
writeln(p);
readln;
end.
why it doesn't work when using only one pointer to char e.g
uses strings;
type
ppchar = ^pchar;
procedure changestr(s : pchar);
begin
getMem(s,16);
strcopy(s,'Hello World');
end;
var
p : pchar;
begin
changestr(p);
writeln(p); // print nothing !!
readln;
end.