[fpc-pascal] Dynamic arrays, yet another pitfall

Sven Barth pascaldragon at googlemail.com
Sun Feb 9 17:47:59 CET 2014


On 09.02.2014 16:34, Flávio Etrusco wrote:
>
> In other words: dynamic arrays are like AnsiStrings without the
> copy-on-write semantics. I'd certainly wish Borland copied the COW
> semantics :-/

Dynamic arrays have full COW semantics. If Jürgen would have provided a 
full compilable example we could check whether he has a bug in his own 
code or there is a bug in the compiler as certainly the result of his 
first code snipped must be length 10 for array "A" and length 20 for 
array "B". His second example is as expected and as designed.

Regards,
Sven



More information about the fpc-pascal mailing list