Yes, we can combine C and C++ source code. You need to use extern “C” for the same. Let see an example,
// C++ code
extern "C" void foo(int); // one way, foo is C function
extern "C" { // another way, fun and test are C functions
int fun(double);
double test();
};
Answer :
Yes, we can combine C and C++ source code. You need to use extern “C” for the same. Let see an example,
need an explanation for this answer? contact us directly to get an explanation for this answer