ex46.pp 313 B

123456789101112131415161718
  1. Program Example46;
  2. { This program demonstrates the StrBufSize function }
  3. {$H+}
  4. Uses sysutils;
  5. Const S = 'Some nice string';
  6. Var P : Pchar;
  7. Begin
  8. P:=StrAlloc(Length(S)+1);
  9. StrPCopy(P,S);
  10. Write (P, ' has length ',length(S));
  11. Writeln (' and buffer size ',StrBufSize(P));
  12. StrDispose(P);
  13. End.