delphi 合并动态数组

delphi 合并动态数组
procedure TForm2.btn1Click(Sender: TObject);
var
  arr1, arr2: TBytes;
  len: Integer;
begin
  SetLength(arr1, 3);
  SetLength(arr2, 3);

  arr1[0] := 65;
  arr1[1] := 66;
  arr1[2] := 67;
  arr2[0] := 68;
  arr2[1] := 69;
  arr2[2] := 70;

  len := Length(arr1);
  SetLength(arr1, len + Length(arr2));
  CopyMemory(@arr1[len], arr2, Length(arr2));
  ShowMessage(StringOf(arr1)); { ABCDEF }
end;
posted @ 2013-04-06 19:51  Wishmeluck  阅读(175)  评论(0编辑  收藏  举报