Quantcast
Channel: fscked.org - BlackMagic
Viewing all articles
Browse latest Browse all 4

C++ Functor to C Function Pointer Conversion

$
0
0

Pop quiz hotshot: You're on a bus with no Internet connection. You absolutely need to interface some new C++ code with a shoddy old C interface based on function pointers. The new C++ code makes heavy use of functors to carry state between call invocations. The C code must call these C++ functors by way of a function pointer, and only a function pointer. Your function pointer prototype cannot take any additional arguments for the class type. What do you do? What do you do...

read more


Viewing all articles
Browse latest Browse all 4

Trending Articles