Explain how to call C functions from C++.
- The extern keyword is used to call C functions from C++.
- This works only for non-member functions.Example:
extern “c” void showme()
- If you want to call a member functions including virtual functions from C, you just need to provide a simple wrapper.Example:
extern “C” double call_c_f(C* p, int j) //wrapper function