How to initialize a static array?

后端 未结 3 1898
鱼传尺愫
鱼传尺愫 2021-01-06 08:50

Let\'s say I have this declaration:

TYPE
 RDisk= packed record
   R2: array[1..1024] of Byte;
   etc
   etc
  end;

How do I initialize R2 t

3条回答
  •  滥情空心
    2021-01-06 09:08

    You can initialize an array with zero using this

    ZeroMemory(@R2[0],length(R2));
    

    or this

    FillChar(R2[0],length(R2),0); 
    

提交回复
热议问题