Code I've never seen before

S

Sharron

All I need some help...I have never seen the code below before and need
to know what is the formal name for what the constructor statement below
is doing (if I have the formal name then I can look it up). It looks
like its initializing the private variables for the class (classA) but I
don't know what you call it...

classA::classA (int var1) :
privateClassAVar1 (0.0),
privateClassAVar2 (0.0),
privateClassAVar3 (0.0)
{};
 
M

Mike Wahler

Sharron said:
All I need some help...I have never seen the code below before and need
to know what is the formal name for what the constructor statement below
is doing (if I have the formal name then I can look it up). It looks
like its initializing the private variables for the class (classA) but I
don't know what you call it...

classA::classA (int var1) :
privateClassAVar1 (0.0),
privateClassAVar2 (0.0),
privateClassAVar3 (0.0)
{};

"Initalizer list" or
"Member initalizer list"

-Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top