what does ":" do in c++ code?

Newbie Member
27Sep2007,14:25   #1
asilter's Avatar
i'm trying to read and understand a .cc (c++)file,
i want to know what does ok_flag(false),time_range(false),prefix() do after ":" ?
I did know that ":" was being used for class inheritance but what is ":" for in the bleow code?
Code:
ClassA::ClassA(const char *db) : ok_flag(false),time_range(false),prefix()
{
//.. Constructor statements
}
plz help
thanx.
Team Leader
27Sep2007,17:02   #2
DaWei's Avatar
It initializes those variables in the class. It's more effective than putting statements inside the constructor.
Go4Expert Founder
27Sep2007,17:16   #3
shabbir's Avatar
As far as I can remember its called initialization block.
Newbie Member
27Sep2007,18:55   #4
asilter's Avatar
ok,thanks.