Q:
How can you use a C-function, defined in a separate file, in a method of a C++-class?
----------
A:
By declaring the C-function as extern "C", the C-compiler will know that it is an externally declared function and that it is exists in the C-scope of memory.
Example:
Contents of func.c-file:
int func(void)
{
/* My function */
}
In your C++-file your declare the external function func() as:
extern "C" int func(void);
----------
This FAQ was generated from the following thread: How can you use a C-function, defined in a separate file, in a method of a C++-class?