如何解决如何在类中定义libusb_log_cb函数?
如何在类内部定义libusb_log_cb函数?我需要访问此类的变量。
例如:
foo.h
class foo
{
...
private:
int r;
void handleLog(libusb_context *ctx,enum libusb_log_level level,const char* str);
};
foo.cpp
...
void foo::handleLog(libusb_context *ctx,const char* str)
{
...
std::cout << r << "\n";
}
...
libusb_set_log_cb(...,handleLog,...); // Error. Cause this function is a member of the foo class
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。