Problems with function as parameter
Mike Parker
aldacron at gmail.com
Fri Sep 22 02:21:11 UTC 2017
On Friday, 22 September 2017 at 02:18:34 UTC, Mike Parker wrote:
>>
>> and use & to reference the function instead of calling it:
>>
>> Mix_ChannelFinished(&channelDone);
To expand on this, D allows functions to be called without
parentheses. `channelDone` is actually a function call, whereas
in C, it's treated as a function pointer. In D, you have to take
the address of a function just as you would any other type, hence
`&channelDone`.
More information about the Digitalmars-d-learn
mailing list