title: Trying to assign a new derived object to a base class pointer but it seems to act like nothing happened
body: <p>Thanks in advance for the replies.</p>
  
  <p>store() is a function of Backpack class which is holding an array of pointers (Item * items). The arguments sent to store() are correct (tested by printing them out with cout). displayInventory() still prints the previous Item object's members at the end of the function.</p>
  
  <pre><code>void store(string &amp; name, float weight, int power, int slot)
          {
              items[slot] = new Weapon(name, weight, power); // Weapon is a derived class of Item
              this-&gt;displayInventory();
          }
  </code></pre>
  
  <p>Thanks.</p>
  
  <p>EDIT: Researching vectors now.</p>