A C++ Question

PeteT

Warlord
Joined
Jan 2, 2002
Messages
273
Location
Winterpeg
Can anyone tell me (or point me to where I can get info) about the difference between:

Style 1:

Code:
MyClass::MyClass()
{
	m_iMyMember = 0;
}

and

Style 2:

Code:
MyClass::MyClass() :
m_iMyMember(0)
{
}


Style 1 is the normal procedure but occasionally I've seen people using Style 2. Presumably there's some advantage to it in some circumstances. Does anybody know what it could be? :confused:

Thanks in advance.
 
It's stylistic so pertaining more to aesthetics than function. The second can be more concise...
 
Back
Top Bottom