recommended method of initializing classes

Mar 8, 2011 at 7:27am
Hi -

I'm trying to figure out the "right" way of doing this. I have a class cell, which contains instances of another class reg. When I create an object of class cell, I want to initialize the reg objects within it. What's the preferred way of doing this?

Thanks...I can give more details if needed.
Mar 8, 2011 at 8:08am
You can do it in the constructor for the cell class.
Mar 8, 2011 at 8:47am
closed account (z05DSL3A)
[10.6] Should my constructors use "initialization lists" or "assignment"?
http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6
Mar 8, 2011 at 4:12pm
You can do it in the constructor for the cell class.

Of course. I think I must have had an extra course of stupid salad yesterday. Thanks for the answer, Tamao. Thanks for the link, too, Wolf.
Topic archived. No new replies allowed.