static Master& getInstance(const string& msgQname);
MsgQ msgQ; // need to initialize with message queue name (strig) in
// its constructor
MsgQ *msgQ; // pointer as per my solution. But what if i want to intialize object above
/*Do not get confused in above two declaration. You can treat them as OR i want tips from u is it possible to initialize "MsgQ msgQ"*/
string msgQname; // My solution as mentioned
Master& Master::getInstance(const string& msgQname)
msgQname = msgQname;
static Master master;
// My solution : Usage
msgQ = new MsgQ(msgQname);
...static member functions have no this pointer...(emphasis added)
-Where exactly is line 29 supposed to be?
Can you clarify what it is you're asking?
Going to take a stab at guessing what you're asking. If you're asking how to initialize data members in a singleton class, one solution would be to simply provide arguments through both the GetInstance() function and a Master constructor, e.g.