basic question about adresses and values in structs

nikki via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 4 02:54:56 PDT 2014


thanks! just what I needed, with some stumbling I managed to get 
everything working as intended: using a pointer variable to save 
an adres of a function, then dereferencing to use it.

Now I am wondering when to use the ** ?

for example I found this function over at 
https://github.com/d-gamedev-team/gfm/blob/master/core/gfm/core/memory.d

void* storeRawPointerAndReturnAligned(void* raw, size_t 
alignment) nothrow
     {
         enum size_t pointerSize = size_t.sizeof;
         char* start = cast(char*)raw + pointerSize;
         void* aligned = nextAlignedPointer(start, alignment);
         void** rawLocation = cast(void**)(cast(char*)aligned - 
pointerSize);
         *rawLocation = raw;
         return aligned;
     }

it's a little over my head yet..


More information about the Digitalmars-d-learn mailing list