Composition

Introduction

The process of building complex objects from simpler ones is called composition.
More specifically, composition is used for objects that have a has-a relationship to each other.

Initializing class member variables

PersonalComputer::PersonalComputer(int nCPUSpeed, char *strMotherboardModel, int nRAMSize)
    : m_cCPU(nCPUSpeed), m_cMotherboard(strMotherboardModel), m_cRAM(nRAMSize)
{
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.