ex109.pp 382 B

12345678910111213141516171819
  1. Program Example109;
  2. { Program to demonstrate the MoveChar0 function. }
  3. Var
  4. Buf1,Buf2 : Array[1..80] of char;
  5. I : longint;
  6. begin
  7. Randomize;
  8. For I:=1 to 80 do
  9. Buf1[i]:=chr(Random(16)+Ord('A'));
  10. Writeln('Original buffer');
  11. writeln(Buf1);
  12. Buf1[Random(80)+1]:=#0;
  13. MoveChar0(Buf1,Buf2,80);
  14. Writeln('Randomly zero-terminated Buffer');
  15. Writeln(Buf2);
  16. end.