Original Post
Okay, basically what i''m trying to do is delare a function pointer in a class that points to a function in the same class. Something like this...
class Creature{
public:
int X;
void (*Move)();
void Walk();
void Run();
};
void Creature::Walk(){ // Normal movement
X += 1;
};
void Creature::Run(){ // Fast movement
X += 5;
};
void Main(){
Creature C1;
C1.Move = C1.Run; // Now i try to set the pointer to my
// function and it crashes
};
If anyone knows how to do this please tell me, this has been bothering me for weeks. Thanks!