Saturday, May 9, 2015

Cocos2dx: Difference between ampersand and asterisk


Ampersand  & is a reference. It cannot be modified.

eg:

bool onContactBegin(cocos2d::PhysicsContact &contact);



Asterisk  * is a pointer. It can be modified.

eg:

bool onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *event);

No comments:

Post a Comment