0
votes
A String of Byte?
The Programming Works
– Dynamic arrays are implemented in Delphi as lifetime-managed reference types without “copy-on-write” support. What does it mean on practice can be shown by the following code: program Project1; {$APPTYPE CONSOLE} type TIntArray = array of Integer; var A, B: TIntArray; begin A:= TIntArray.Create(1,2,3) B:= A; // B = (1,2,3) A[0]:= 10; // A = (10,2,3), B = (10,2,3) Writeln(B[0]); readln; end. A and B are just the same references, so by changing a value referenced by A we also change the same value referenced by B. That makes dynamic arrays different from ...
Statistics
|
Visits by Source |
User Actions |




