copymemory问题(100)

W

wpw72

Unregistered / Unconfirmed
GUEST, unregistred user!
aRecNo为动态数组,整型。我想删除数组中第i个元素,用如下语句CopyMemory(@aRecNo, @aRecNo[i + 1], (High(aRecNo) - i));SetLength(aRecNo, (High(aRecNo)));如aRecNo为(10,11,12,13,14,15),i=2,执行语句后aRecNo就为(10,11,13,13,14),这是为何,我想它为(10,11,13,14,15)
 
因为....integer数据占用4个字节,你的copymemory最后一个参数要*sizeof(integer)
 

Similar threads

回复
0
查看
684
不得闲
S
回复
0
查看
956
SUNSTONE的Delphi笔记
S
S
回复
0
查看
779
SUNSTONE的Delphi笔记
S
顶部