ex40.pp 398 B

12345678910111213141516171819
  1. Program ex40;
  2. { Program to demonstrate the NewStr function }
  3. Uses Objects;
  4. Var S : String;
  5. P : PString;
  6. begin
  7. S:='Some really cute string';
  8. Writeln ('Memavail : ',Memavail);
  9. P:=NewStr(S);
  10. If P^<>S then
  11. Writeln ('Oh-oh... Something is wrong !!');
  12. Writeln ('Allocated string. Memavail : ',Memavail);
  13. DisposeStr(P);
  14. Writeln ('Deallocated string. Memavail : ',Memavail);
  15. end.