The following code example is taken from the book
Object-Oriented Programming in C++
by Nicolai M. Josuttis, Wiley, 2002
© Copyright Nicolai M. Josuttis 2002
/* constructor for last name and first name
* - default for first name: empty string
*/
Person::Person(const std::string& ln, const std::string& fn)
: lname(ln), fname(fn) // initialize first and last names with passed parameters
{
// nothing else to do
}