J
Jake
I'm getting an error trying to do a callback. Is this a valid way to do
a callback in C++? The callback comes from a C library that I include
and link with.
MyClass.cpp: In member function 'void MyClass::functionA()':
MyClass.cpp:18: error: argument of type 'void (MyClass:(const char*)'
does not match 'void (*)(const char*)'
---
#include <callbacks.h>
void MyClass::functionA() {
registerMyCallbackFunc(myCallbackFunc);
return;
}
void MyClass::myCallbackFunc(const char *id) {
printf("my id = %c\n", id);
return;
}
a callback in C++? The callback comes from a C library that I include
and link with.
MyClass.cpp: In member function 'void MyClass::functionA()':
MyClass.cpp:18: error: argument of type 'void (MyClass:(const char*)'
does not match 'void (*)(const char*)'
---
#include <callbacks.h>
void MyClass::functionA() {
registerMyCallbackFunc(myCallbackFunc);
return;
}
void MyClass::myCallbackFunc(const char *id) {
printf("my id = %c\n", id);
return;
}