Possible Duplicate:
Class construction with initial values
While I was looking at c++ example in http://en.wikipedia.org/wiki/Delegation_pattern I noticed something I haven't seen before:
C() : i(new A()) { }
My question is: How is this line of code any different from:
C() {
i = new A();
}
What does :
after constructor do? What does the brackets around new A()
do?