4.
|
A constructor initializer:
Please select the best answer.
|
|
A.
|
initializes each data member to 0
|
|
B.
|
initializes data members with the value in parentheses
|
|
C.
|
calls default constructor to initialize each data member
|
|
D.
|
may only be used in a copy constructor
|
|
The correct answer is B.
A constructor initializes data members with a value in parentheses, as in
foo(int i) : a(i) { ..... }
.
The member a is initialized with i .
|