Original Post
Hey there, can anyone help me figure out why this won't work?:
When compiling in Microsoft Visual C++ 6.0 I get the following error message:
c:\cstuff\ptofunction\pointer.cpp(8) : error C2440: '=' : cannot convert from 'void (__thiscall myClass::*)(void)' to 'void (__cdecl *)(void)'
There is no context in which this conversion is possible
Thanks in advance!
=========================
"The staff in the hand of a wizard may be more than a prop for age," -Hamá the doorward from 'Lord of the Rings' by J. R. R. Tolkien
Edited by - HimitsuMonban on January 5, 2002 3:05:59 AM
#include <iostream.h>
class myClass
{
public:
myClass(void)
{
think = myFunction;
}
void (*think)(void);
void myFunction (void)
{
cout << "Hello" << endl;
}
};
void main (void)
{
myClass object;
object.think();
} |