希望任何人都可以幫助我。 我想弄清楚在一個方法的調用中傳遞一個對象的指針是什麼。 所以(在cocos2d的環境),這將是這樣的: - (void)loadCreature:(CCSprite*)creature
{
if (/*here I want to check if the pointer is 'blue'*/) NSLog(@"the creature is blue")
現在如何處理一個類的函數指針到另一個類的函數?這是我的問題 例子: class Apple
{
int(Apple::*pActionFunc)(void);
};
class Tree
{
Apple* tempy;
void Init(void);
int I_Work(void);
};
void Tree::Init(void)
我有以下主要功能,使用指針創建係數的乘積。這只是項目的一小部分,用於創建多項式: #include "header.h"
int main()
{
TermProd x = TermProd(new Coeff(4), new Coeff(8));
x.print(); cout << endl;
x = TermProd(new Coeff(8), new Co