type
...
SmallIntRA0 = array [0..0] of SmallInt;
SMallIntp0 = ^SmallIntRA0;
var
...
gBuff16: SmallIntP0;
being
...
for i := 0 to 10000 do begin //jjjjjj
if gBuff16[i] < 20 then
...
end;
end.
当i=1下标越界,如何才能在不改变 type 和 var 部分的情况下 ,
使下标不越界
...
SmallIntRA0 = array [0..0] of SmallInt;
SMallIntp0 = ^SmallIntRA0;
var
...
gBuff16: SmallIntP0;
being
...
for i := 0 to 10000 do begin //jjjjjj
if gBuff16[i] < 20 then
...
end;
end.
当i=1下标越界,如何才能在不改变 type 和 var 部分的情况下 ,
使下标不越界
setlength(a,100) 分配100个空间以后不够再加
setlength(a,1000)
type
...
SmallIntRA0 = array [0..0] of SmallInt; 呢?SmallIntRA0 = array of SmallInt不可以吗?可以用SetLength(a,10000)来分配空间。
用SetLength(a,10000)多次分配,可能也会出问题
所以用指针
SMallIntp0 = ^SmallIntRA0;
gBuff16: SmallIntP0;