I have a struct which I wish to contain a function pointer.
in the struct it is declared as
int (*pValidate)(byte*,std::istream*);//function Pointer
In the same .h file I have the function declared as
class foo
{
public:
int __cdecl ValidateUL(byte* pData,std::istream* S);
...
}
In my .cpp file I have the lines
MyStruct D;
D.pValidate = &foo::ValidateUL;
But when I try to compile it I get an error message. I assume it is something to do with the way I have declared the f.p, or am allocating it, but I can't see what.
Any ideas ?
K
in the struct it is declared as
int (*pValidate)(byte*,std::istream*);//function Pointer
In the same .h file I have the function declared as
class foo
{
public:
int __cdecl ValidateUL(byte* pData,std::istream* S);
...
}
In my .cpp file I have the lines
MyStruct D;
D.pValidate = &foo::ValidateUL;
But when I try to compile it I get an error message. I assume it is something to do with the way I have declared the f.p, or am allocating it, but I can't see what.
Any ideas ?
K