![]() |
what does ":" do in c++ code?
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()thanx. |
Re: what does ":" do in c++ code?
It initializes those variables in the class. It's more effective than putting statements inside the constructor.
|
Re: what does ":" do in c++ code?
As far as I can remember its called initialization block.
|
Re: what does ":" do in c++ code?
ok,thanks.
|
| All times are GMT +5.5. The time now is 14:40. |