Set null as function array parameter

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jan 12 07:59:42 PST 2015


On Monday, 12 January 2015 at 15:51:17 UTC, Oleg wrote:
> void foo(ref int[] param1) {}

Why are you using ref? Take that off and you can pass any array, 
including null, with ease.

The only difference is changes to length won't be seen outside 
the foo function.


More information about the Digitalmars-d-learn mailing list