数组
看http://qc.embarcadero.com/wc/qcmain.aspx?d=20086
fpc编译结果一样!
type TVector = array of integer; TMatrix = array of array of integer; procedure TForm1.Button1Click(Sender: TObject); var A, B : TMatrix; C, D : TVector; begin SetLength(C, 2); C[0] := 1; //this duplicates the vector D := Copy(C); D[0] := 2; //correctly shows "1" ShowMessage(IntToStr(C[0])); SetLength(A, 2, 2); A[0,0] := 1; //this should duplicate the matrix B := Copy(A); B[0,0] := 2; //oops: it shows "2" ShowMessage(IntToStr(A[0,0])); end;
Drupal theme by Kiwi Themes.