I have a c++ class and c code as well. Following is rough (logically the same) and minimalised code
// C++ class - Car.cpp
void Car :: initialise()
{
WheelT mWheel; // WheelT is a struct in Wheel.c
mWheel.run(wheelGotFlat); // <---- I want to pass here the c++ callback method , so that if the wheel goes flat , the callback should hit
}
static void car :: wheelGotFlat() // <--- callback method
{
}
// C code - Wheel.c
void checkStatus(callback aCb)
{
// if wheel is flat
// ----- here I want to hit the callback method that was passed as argument to run()
}
void run(callback aCb)
{
checkStatus(aCb);
}
How to do this ??