How can I expose C++ function pointers in C?

前端 未结 4 1486
盖世英雄少女心
盖世英雄少女心 2021-01-19 16:57

I have two types of function pointers defined in my C++ that look like this:

typedef void(*CallbackFn)(bool, std::str         


        
4条回答
  •  温柔的废话
    2021-01-19 17:24

    You can expose a function to C by declaring it extern "C".

    However, the function must only accept argument types that are valid in C.

    From the look of the code above, you're going to have to express your callback in more C-like terms.

提交回复
热议问题