读书人

怎么实现常量数组赋值给记录中动态数组

发布时间: 2012-03-05 11:54:01 作者: rapoo

如何实现常量数组赋值给记录中动态数组(在线等)急!急!急!
RT

ex.
type
Tc=record
b:array of Integer;
end;
const a:array[1..5] of Integer=(1,2,3,4,5);

begin
//How to assign a to b?
end;



[解决办法]

Delphi(Pascal) code
var  c:tc;begin  c.b:=@a;end;
[解决办法]
楼上的没错,不过最好这样
Delphi(Pascal) code
var  c: Tc;begin  c.b := @a;  SetLength(c.b,5);end; 

读书人网 >.NET

热点推荐