Hi all,
is there any way where I can call c++ code from a c code
class a
{
someFunction();
};
how to call someFunction()
from a c code.
in other way I am asking how to avoid name mangling here
regards Vinayaka Karjigi
Hi all,
is there any way where I can call c++ code from a c code
class a
{
someFunction();
};
how to call someFunction()
from a c code.
in other way I am asking how to avoid name mangling here
regards Vinayaka Karjigi
(I don't remember all the damned cast operators for C++ off-hand and am too lazy to look it up, so replace (Foo*) with a more specific cast if you like in the following code.)
// My header file for the C API.
extern "C"
{
void bar(void* fooInstance);
}
// My source file for the C API.
void bar(void* fooInstance)
{
Foo* inst = (Foo*) fooInstance;
inst->bar();
}