J
jbas
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);
var
kk:array of array of integer;
i,j:integer;
begin
i:=2;
j:=3;
setlength(kk,i,j);//定义一个1*2的二维数组.
kk[i,j]:=2
//编译出错.
kk[i-1,j]:=2;//编译通过.
kk[i-1,j+1]:=2
//编译通过.why???kk[0,3]怎么不出错,而kk[1,2]出错???难道kk的边界不是kk[0..1,0..2]??
end;
var
kk:array of array of integer;
i,j:integer;
begin
i:=2;
j:=3;
setlength(kk,i,j);//定义一个1*2的二维数组.
kk[i,j]:=2
//编译出错.
kk[i-1,j]:=2;//编译通过.
kk[i-1,j+1]:=2
//编译通过.why???kk[0,3]怎么不出错,而kk[1,2]出错???难道kk的边界不是kk[0..1,0..2]??
end;