必须使用循环!!在书上应该有很明确地说:数组间不可以直接赋值的!欢迎参观:http://expert.csdn.net/expert/topic/707/707543.xml

解决方案 »

  1.   

    CopyMemory(dest,src,sizeof(src));
      

  2.   

    setLength(strArray,5);
        setLength(strArraydic,5);
        setlength(strTempA,5);
        strArray[0] := '2';
        strArray[1] := '1';
        strArraydic[0] := '21';
        strArrayDic[1] := '22';
        strTempA := copy(strArray,0,5);
        strArray := copy(strArraydic,0,5);
        strArraydic := copy(strTempA,0,5);
      

  3.   

    用一个循环就可以了
    A[I]:=B[I];
      

  4.   

    move(Array1[0],Array2[0],Length(Array1))     ____     ____
         \ p \   / g /
          \ l \_/ n /
           \ a   o /
            \ i s /
             \ n /
              \_/
      

  5.   

    错了:
    move(Array1[0],Array2[0],Length(Array1)*Sizeof(Array1[0]));0D
    如果元素类型是接口、Variant/OleVariant等,就必须用循环了。     ____     ____
         \ p \   / g /
          \ l \_/ n /
           \ a   o /
            \ i s /
             \ n /
              \_/
      

  6.   

    这两个数组需要建立两个拷贝,不可以互相影响。
    Copy我用了,一维的时候没有问题,二维的时候有问题,给一个数组付值会影响另一个数组。Move可能也会有这个问题。
    在一个数组从另一个数组取的数据后,两个数组还同时要有不同的工作。
    怎么办。
      

  7.   

    二维动态数组赋值必须用循环,因为它是指针的数组,而不是数组的数组,它所用的内存是不连续的.(也可能凑巧连续)     ____     ____
         \ p \   / g /
          \ l \_/ n /
           \ a   o /
            \ i s /
             \ n /
              \_/
      

  8.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      A1,A2:array of array of Double;
    begin
      SetLength(A1,3,3);
      SetLength(A2,3,3);
      A1[0,0]:=1;
      A1[1,0]:=2;
      A1[2,0]:=3;  A1[0,1]:=4;
      A1[1,1]:=5;
      A1[2,1]:=6;  A1[0,2]:=7;
      A1[1,2]:=8;
      A1[2,2]:=9;
     
      CopyMemory(A2,A1,9*SizeOf(Double));  A2[0,0]:=11;
      A2[1,0]:=12;
      A2[2,0]:=13;  A2[0,1]:=14;
      A2[1,1]:=15;
      A2[2,1]:=16;  A2[0,2]:=17;
      A2[1,2]:=18;
      A2[2,2]:=19;  Label1.Caption:=floattostr(A1[0,0]);
      Label2.Caption:=floattostr(A1[1,0]);
      Label3.Caption:=floattostr(A1[2,0]);  Label4.Caption:=floattostr(A1[0,1]);
      Label5.Caption:=floattostr(A1[1,1]);
      Label6.Caption:=floattostr(A1[2,1]);  Label7.Caption:=floattostr(A1[0,2]);
      Label8.Caption:=floattostr(A1[1,2]);
      Label9.Caption:=floattostr(A1[2,2]);
      //结果发现A2和A1并不是2个独立的数组,发现A2是A1的指针
      //如何才能实现2个独立动态数组的快速拷贝????????,不用循环end;end.