Referring to the sample code above, on which one of the following lines does an initializer list occur?

Q

1: class Foo {
2: int size; string name; double value;
3:
4: public:
5: Foo() : size(0), name("unknown"), value(0.0) {
6: }
7: Foo(int s) {
8: size = s; name = "unknown"; value = 0.0;
9: }
10: Foo(int s = 0, string n = "unknown", double v=0) {
11: size = s; name = n; value = v;
12: }
13: };

Referring to the sample code above, on which one of
the following lines does an initializer list occur?
1) Line 2
2) Line 5
3) Line 8
4) Line 10
5) Line 11


✍: Guest

A
(This question has not been answered yet. If you know the answer, please share it in a comment below.)

2012-04-26, 2583👍, 0💬