G + + an error: invalid conversion from "void (*) (void *, int * (*) (), int, int) 'to' void (*) (void *, int, int, int) [- fpermissive]
'Please give an explanation of the ~
# include & lt; Iostream>
Call_back typedef void (*) (void *, int, int, int).
Void GetProcess (call_back cb, void * cb_class)
{
Float process=0.8;
If (cb)
{
Cb (cb_class, 0, 1, 1);
}
}
Void callback (void * cl, int errno, int a, b int)
{
Printf (" % d \ n ", errno);
}
Int main (int arg c, char * * argv)
{
GetProcess (callback, nullptr);
return 0;
}
CodePudding user response:
Parameter int errno change a name, errno is a macroCodePudding user response:
In fact have to remind you, void callback (void * cl, int errno, int a, int b); The errno is red, it's a red, you define the variable names and the inside of the c + + macro repeatedCodePudding user response:
Change. C, GCC compiler no problem,.cpp, g + + compiler has a problem, it seems the g + + check too cattle,