still confused about call by reference

Bill Baxter dnewsgroup at billbaxter.com
Wed Oct 31 18:57:20 PDT 2007


Hoenir wrote:
>> That gets you a pointer.  You don't need & to pass a value type to a 
>> 'ref' parameter.
> 
> No I meant the argument passing:
> 
> void foo(Struct& S)
> {...}

In D that's written:

void foo(ref Struct S)
{...}

And called like:

Struct s;
foo(s);

--bb


More information about the Digitalmars-d-learn mailing list