今度は、クラスの関数ポインタが別のクラスの関数を指していますか?このクラスの関数ポインタをこの他のクラスの関数で埋めることができない
class Apple
{
int(Apple::*pActionFunc)(void);
};
class Tree
{
Apple* tempy;
void Init(void);
int I_Work(void);
};
void Tree::Init(void)
{
tempy = new Apple();
tempy->pActionFunc = &Tree::I_Work;
}
int Tree::I_Work(void)
{
"Do Things"
}
動作しません:それは私の質問
例です。何故ですか?
なぜファンクタまたはインターフェイスを使用できるときに関数ポインタを使用しますか? – AlexTheo
http://blogs.msdn.com/b/oldnewthing/archive/2004/02/09/70002.aspxこれはメソッドポインタについての非常に良い情報です。とにかく私はこの仕事をすることができますを楽しむと助けてください – Nico