I am a newbie of using c++. I am following a tutorial to get some idea of basic structure of C++ and I see function calls in the header files.
I have something like this
class cuserlist : public cmutex
{
private:
list < cuser* >_clientlist;
bool init ();
bool destroy ();
public:
cuserlist ()
{
init ();
}
~cuserlist ()
{
destroy ();
}
bool add(int cfd);
bool remove(int cfd);
cuser* find(int cfd);
list < cuser* > * getclientlistptr() {
return &_clientlist;
}
};
In this header file it calls init() function in the constructor declaration. I can assume that it will call the function whenever user create cuserlist class but don't see the exact moment when it is going to be called and how it works.
Thanks in advance.