1,用结构体 + 内存数组来取代多维数组,效率上也高一点2,TP是一个函数的指针,两个实例指向的是同一个地址,当然结果一样3,不知道怎么回事,你这样应该可以的4,没什么大区别,但封装成类易于管理,可读性强5,pascal中的引用好象有一个out关建字,相当于C++中的&操作符,能使用用引用时尽量不要使用指针6,前一个p没有分配内存,p指向i的地址,i的值变化p^也变
   后一个p分配了内存.......,不需要nil;

解决方案 »

  1.   

    1、type
       tarr= array of array of integer;
    type
      TForm1 = class(TForm)
        private
        { Private declarations }
      public
        { Public declarations }
      procedure setdata(arr:tarr);
      end;
    var
      Form1: TForm1;
    implementation{$R *.DFM}{ TForm1 }procedure TForm1.setdata(arr:tarr);
    beginend;
      

  2.   

    呵呵,Crob已经回答得很完善了,没什么可说的……
      

  3.   

    1。在DELPHI中进行数组传递要注意它们之间的关系,我们一般要这样做  声明一个类型
      type simm=array[0..10] of integer;  在被调用端和调用端的声明里都用simm做为类型;
    2。正在调试
    3。很奇怪,没见过类似的情况。
    4。程序增大,内存也会相应增加;
    5。引用为var,而不是out,out其实是在typelibrary里对应IDL才有的东东;
    6。同意楼上
      

  4.   

    补充一点上面的5
    out只能为output,而不能为input,虽然也有一点引用的说法
    让我们看看原文
    An out parameter, like a variable parameter, is passed by reference. With an out parameter, however, the initial value of the referenced variable is discarded by the routine it is passed to. The out parameter is for output only; that is, it tells the function or procedure where to store output, but doesn抰 provide any input.
      

  5.   

    可能pascal里根本就没有引用(Reference)这一说,引用只是在C++里的&用得比较多