Translating from Objective C to C++

Sorry if this is a stupid question :smiley: but I am trying to translate following this tutorial
http://www.raywenderlich.com/24878/introduction-to-component-based-architecture-in-games

In the below code is a function whose class extends NSObject,

  • (id)initWithEid:(uint32_t)eid {
    if ((self = [super init])) {
    *eid = eid;
    }
    return self;
    }
    When I translate it as:
    bool initWithEid
    {
    if //Problem is here; CCObject does not have a init function
    *eid=eid;

}
}

So do not call it.

Well, that worked! Btw could you please tell me what is the purpose of ‘init’ function? It is present in all the cocos objects. Actually, I haven’t been able to understand the flow of control of Cocos2d-x. So, will be grateful for your help

See wiki and especially this page: [[Easy_to_Learn*-*API_Style]].