I am doing the beginners tutorial and I have never seen the : operator after a constructor. Can someone explain to me what Example2 (int initial_value) : total(initial_value) means?
1 2 3 4 5 6
class Example2 {
public:
int total;
Example2 (int initial_value) : total(initial_value) { };
void accumulate (int x) { total += x; };
};