Passing Structs to function like in C

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Aug 14 07:59:17 PDT 2016


On Sunday, 14 August 2016 at 14:54:27 UTC, D.Rex wrote:
> Speaking of classes, and this may have been answered elsewhere, 
> but I am yet to find said answer, or am just missing something 
> right in front of my face...but how does one go about accessing 
> a method from a class if said class is passed to a function as 
> a pointer?

It just works with the regular dot.

But don't pass classes as pointers in D except in very rare 
circumstances. They are already pointers under the hood 
automatically.


More information about the Digitalmars-d-learn mailing list