Explain how to call C functions from C++

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
How to declare a class as a friend of another class - C++
How to declare a class as a friend of another class..
Class vs. Structure - C++
Class vs. Structure - Class has private as default access specifier.Default inheritance type is private......
How to call a base member function from derived class member function.
How to call a base member function from derived class member function....
Post your comment