ex70.pp 375 B

12345678910111213141516171819202122
  1. Program Example70;
  2. { Program to demonstrate the StringToPPchar function. }
  3. Uses linux;
  4. Var S : String;
  5. P : PPChar;
  6. I : longint;
  7. begin
  8. // remark whitespace at end.
  9. S:='This is a string with words. ';
  10. P:=StringToPPChar(S);
  11. I:=0;
  12. While P[i]<>Nil do
  13. begin
  14. Writeln('Word ',i,' : ',P[i]);
  15. Inc(I);
  16. end;
  17. FreeMem(P,i*SizeOf(Pchar));
  18. end.