I'm working from the book "C++ How to Program" . I couldn't get the member initializers and I couldn't find it on the documentation here . Can someone explain it
1 // Fig. 10.5: Increment.cpp
2 // Member-function definitions for class Increment demonstrate using a
3 // member initializer to initialize a constant of a built-in data type.
4 #include <iostream>
5 using std::cout;
6 using std::endl;
7
8 #include "Increment.h" // include definition of class Increment
9
10 // constructor
11 Increment::Increment( int c, int i )
12 : count( c ), // initializer for non-const member
13 increment( i ) // required initializer for const member
14 {
15 // empty body
16 } // end constructor Increment
17
18 // print count and increment values
19 void Increment::print() const
20 {
21 cout << "count = " << count << ", increment = " << increment << endl;
22 } // end function print