On Thu, Nov 23, 2023 at 07:22:22PM +0000, BoQsc via Digitalmars-d-learn wrote:
> Is it possible to declare empty pointer variable inside function calls
> and pass its address to the function?
> 
> These are sometimes required while using Win32 - Windows Operating
> System API.
> 
> * Empty pointer variables are used by functions to return information
> after the function is done.
> 
> My own horrible **suggestion** of empty pointer declaration inside
> function call:
> `someFunction(uint & passingEmptyVariableForWrite);`
> 
> What it would do:
> * A new variable is declared inside function call.
> * Address of that variable is passed to the function.
> * After function is done, you can refer to it for returned value.

What's wrong with:

        uint* result;
        someFunction(&result);
        // use *result

?


T

-- 
One Word to write them all, One Access to find them, One Excel to count them 
all, And thus to Windows bind them. -- Mike Champion

Reply via email to