--
Jason
Thanks and Best Regards!
> hello:
> A stupid question like this:
> when I read the [Inside the C++ object model], I meet a question.
> "You must use the member initialization list, when you call the
> constructo
> of a member class, and it provided with some parameters."
> I can't understand it.
> Anybody can answer me? Thank you very much
The wording is not very clear, but I think this basically means that line
(1) below won't compile, but (2) compiles:
class A {
public:
A(int) {}
};
class B {
A a;
public:
B() {a=1;} // (1) - wrong
B(): a(1) {} // (2) - right
};
There is also a FAQ on that topic:
http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6
hth
Paavo
--
Jason
Thanks and Best Regards!
"Paavo Helde" <myfir...@osa.pri.ee> д����Ϣ����:Xns9CB56CA9B...@216.196.109.131...
Fraser.