Confusion about : and * in object construction

Hi guys!

This is my first post on the forums which is exciting! My first question is probably a pretty simple one (hopefully) - I'm planning to make an addition to the Mixxx open source DJ software, but my coding skills really need to improve.

Anyway, I'm confused about the use of the * and second single : in this statement here:

ControlObjectThread::ControlObjectThread(ControlObject * pControlObject, QObject * pParent) : QObject(pParent),
m_dValue(0,0),
m_pControlObject(pControlObject)
{
stuff;
}

I think I understand that the ControlObjectThread is and object being constructed, with arguments, but I'm not sure what the following colon means? And is the ControlObject * pControlObject some kind of pointer?

Any help would be much appreciated. Thanks in advance!!

Ben

This

1
2
3
: QObject(pParent),
m_dValue(0,0),
m_pControlObject(pControlObject)


is an initialisation list - a convenient and sensible way to set the value of some member variables in the ControlObjectThread object when it is constructed. http://www.learncpp.com/cpp-tutorial/101-constructor-initialization-lists/

And is the ControlObject * pControlObject some kind of pointer?
Yes. A pointer to a ControlObject object.



Thanks mate!
Topic archived. No new replies allowed.