C function taking two function pointers that share calculation

jmh530 john.michael.hall at gmail.com
Wed Sep 14 18:46:50 UTC 2022


On Wednesday, 14 September 2022 at 18:02:07 UTC, JG wrote:
> [snip]
>
> Maybe others know better but I would have thought the only way 
> is to use globals to do this. Often c libraries that I have 
> used get round this by taking a function and a pointer and then 
> the library calls your function on the pointer simulating a d 
> delegate.

The C function does make use of a pointer to some data (that I 
neglected to mention), but your comment gives me an idea. Thanks.


More information about the Digitalmars-d-learn mailing list