To access a non-default constructor of a class member:
Also known as the constructor initialization list.Code:class test { private: std::string name; public test(); ~test(); } // The following line matters: test::test() : name("A name") { }
To access a non-default constructor of a class member:
Also known as the constructor initialization list.Code:class test { private: std::string name; public test(); ~test(); } // The following line matters: test::test() : name("A name") { }