大家帮我看看这个回调函数,该怎么写
typedef void (*snmp_callback)( int, // reason
Snmp*, // session handle
Pdu &, // Pdu passed in
SnmpTarget &, // source target
void * ); // callback data
int get( Pdu &pdu, SnmpTarget &target,
snmp_callback callback,
void * callback_data=0);
看get的第三个参数,我该怎么定义啊,我这样写不对。
snmp_callback test_callback( int, // reason
Snmp*, // session handle
Pdu &, // Pdu passed in
SnmpTarget &, // source target
void * ) // callback data
{
return NULL;
//return 0;//这也不对
}
我是这么调用的 snmp.get(pdu,*target,test_callback,0);
错误提示:
error C2664: 'int __thiscall Snmp::get(class Pdu &,const class SnmpTarget &,void (__cdecl *const )(int,class Snmp *,class Pdu &,class SnmpTarget &,void *),const void *)' : cannot convert parameter
3 from 'void (__cdecl *(int,class Snmp *,class Pdu &,class SnmpTarget &,void *))(int,class Snmp *,class Pdu &,class SnmpTarget &,void *)' to 'void (__cdecl *const )(int,class Snmp *,class Pdu &,class SnmpTarget &,void *)' None of the functions with this name in scope match the target type
各位告诉我该怎么写啊 ,谢谢。