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.
It initializes those variables in the class. It's more effective than putting statements inside the constructor.