Hi!
The variable S would be a null-terminated string if the declaration was right.
'This is a null-terminated string.'#0is longer than 30 chars. Change the declaration to
Var S : String[40]; Then everything is ok.
Original code:
Program three;
Var S : String[30];
P : PChar;
begin
S := 'This is a null-terminated string.'#0;
P := @S[1];
WriteLn (P);
end.
Winni
PS.: The nonsense ' was done by the Forum software