On Thursday, 4 September 2014 at 09:54:57 UTC, nikki wrote:
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..

void** (double ptr) is a pointer to array of pointers(just imagine a crossword where each horizontal letter is part of vertical word) there is little reason to use them in D, mostly to C/C++ interfacing

Reply via email to