title: How to access a function from a derived class from a base object
body: <p>I have a vector array with an object and I have it filled with some of the same objects but also I have it filled with some objects that are derived from the base object. But I cannot get access to the functions on the derived object in the array. Is there away to get access to it?</p>
  <pre><code>vector&lt;BaseObject*&gt; objects;
  if (type == 1)
  {
      objects.push_back(new DerivedObject(var1, var2, var3));
  }
  else
  {
      objects.push_back(new BaseObject(var1, var2)); 
  }
  
  objects[index]-&gt;GetFunctionOnDerivedClass(); // How to do this
  
  </code></pre>