ok yes, I understand that. And the first one is on the stack, but isn't part of it on the heap?
ok yes, I understand that. And the first one is on the stack, but isn't part of it on the heap?
Constructors/destructors do not have return types.Code:void SomeObject(int it) { InitObject(it); };
The SomeObject object (its member variables) is created on the stack. The memory allocated for use by its SomeThing and SomeItem members however comes from the heap.Originally Posted by zcot
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
Yes, thanks for pointing out that oversight. Obviously my cutNpaste when whipping that up was a bit out of hand.Originally Posted by hk_mp5kpdw
So....
Is anybody looking at the function code in relation to memory management?Is there a good and bad about this design?
Is anybody looking at the design?