Update: Thanks for the quick replies and sorry for the duplicate – I didn't know what to search on since I didn't know what that construction is called.
I've only used very, very simple C++ classes (in working with the Arduino) so excuse me if this question is too basic.
I'm trying to understand the code snippet below which is from a Qt BLE example. I've not seen a constructor like this before. Can someone tell me what it is called (style, etc. so I can look it up), and/or what it is doing?
Obviously it is initializing some instances and some variables but I don't understand why the... (they aren't parameters
, so what are they?) "initializers" are outside of the curly braces.
PingPong::PingPong():
m_serverInfo(0), socket(0), discoveryAgent(0), interval(5), m_resultLeft(0), m_resultRight(0),
m_showDialog(false), m_role(0), m_proportionX(0), m_proportionY(0), m_serviceFound(false)
{
m_timer = new QTimer(this);
connect(m_timer, SIGNAL(timeout()), this, SLOT(update()));
}