It is better to be a const function:
CCComponent* getComponent(const char *pName) const.