example of pointer usefulness in D

Jeremy DeHaan via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 21 09:55:08 PDT 2014


On Tuesday, 21 October 2014 at 12:40:57 UTC, w0rp wrote:
> On Tuesday, 21 October 2014 at 12:22:54 UTC, edn wrote:
>> Could someone provide me with examples showing the usefulness 
>> of pointers in the D language? They don't seem to be used as 
>> much as in C and C++.
>
> You can use C libraries in D, and pointers will surely come 
> into regular use there. You could also heap allocate structs 
> and end up with pointers to structs.


Can you do the same with classes if you wanted to avoid a GC
allocation? Just wondering.


More information about the Digitalmars-d mailing list