What do I need to know when mixing C and C++ code?

// C++ code
extern "C" void f(int); // one way
extern "C" { // another way
int g(double);
double h();
};
void code(int i, double d)
{
f(i);
int ii = g(d);
double dd = h();
// ... https://www.myccpay.ltd
}
The definitions of the functions may look like this:

/* C code: */
void f(int i)
{
/* ... */
}
int g(double d)
{
/* ... */
}
double h()
{
/* ... */
}
Last edited on
Topic archived. No new replies allowed.