Ok. I ll note post all the code not to make things complicated. I have two classes:
Code:
class Character
{
...
Weapon rightHand;
...
};
class Weapon : public Item
{
...
}
I want to do this:
Code:
Character newb;
Weapon w;
newb.rightHand = w;
If I undestand correctly newb.rightHand will have a copy of w. Thus you will have double the memory for the a Weapon object. Is that bad programming? Would it make more sense having a pointer that will point to the object Weapon instead of copying the whole object?