+ 1

What does this constructor imply??

class A{ public: A(int i=3):i(++i){} void pri(){cout<<this->i;} the above code has an constructor declared and a colon followed by it with some expressions what do they exactly imply?

30th Nov 2017, 7:52 AM
U L Knw Me soon😉😋
U L Knw Me soon😉😋 - avatar
2 Respostas
+ 1
They are called member initializers. All it does is initialize the specified member variables to the value contained within the parentheses
30th Nov 2017, 7:59 AM
aklex
aklex - avatar
0
thanx @alex can u say why it has 2 paranthesis?
30th Nov 2017, 1:51 PM
U L Knw Me soon😉😋
U L Knw Me soon😉😋 - avatar