一个数组指针的使用【一】

 

type
  TArr = array[0..MaxListSize] of Char;
  PArr = ^TArr;
var
  arr: PArr;
  i: Integer;
begin
  arr := GetMemory(5);
  for i := 0 to 4 do arr[i] := Chr(65+i);
  ShowMessage(PChar(arr)); {ABCDE}

  arr := ReallocMemory(arr, 26);
  ShowMessage(PChar(arr)); {ABCDE}
  for i := 0 to 25 do arr[i] := Chr(65+i);
  ShowMessage(PChar(arr)); {ABCDEFGHIJKLMNOPQRSTUVWXYZ}
end;

 

posted on 2010-07-10 19:05  思想。生活。网络  阅读(122)  评论(0编辑  收藏  举报

导航