Possible Duplicate:
What is this weird colon-member syntax in the constructor?
Hi,
In Sams Teach Yourself C++ in 21 Days book, Day 12: Implementing inheritance, is this code snippet:
Mammal(): itsAge(2) , itsWeight(5) {}
Is this equivalent to saying?
Mammal()
{
itsAge(2);
itsWeight(5);
}
What advantage does the first form have? Especially its usage in the book?
Thanks.