Tag Archives: initialization lists

Initialization Lists in C++

When you first start using C++ you tend to set member variables with default values inside your constructor. For example, you might have a class called Message that has three variables, and your constructor sets the default values like this: Message::Message() { messageLength = 0; messageType = 0; messageBody = “Empty message”; } This is […]