title: Struct as a Base of a Derived Object
body: <p>I need some clarification about Structs as Bases of a Derived Object. .
  The current code I'm maintaining ( Legacy , VS2008 ) had classes with Struct as their bases, and being used like this.</p>
  <pre><code>struct Base 
  {
   int nSomeValue;
   Base(int m_SomeValue): nSomeValue(m_SomeValue){};
  };
  class Derived : public Base
  {
  Derived (int m_OtherValue,int m_SomeOtherValue)
  : nOtherValue(m_OtherValue),nSomeOtherValue(m_SomeOtherValue){};
  ~Derived(){};
  public:
  int nOtherValue;
  int nSomeOtherValue
  };
  
  
  int main()
  {
    Derived* pDerived = new Derived(10,20);
    std::cout&lt;&lt;&quot;Derived Object's Value is &quot; &lt;&lt; pDerived-&gt;nOtherValue &lt;&lt; &quot; and &quot; &lt;&lt; pDerived-&gt;nSomeOtherValue &lt;&lt; std::endl;
    delete pDerived;
    pDerived = NULL;
  }
  </code></pre>
  <p>I noticed that some of the Structs had virtual Destructors in them like this.</p>
  <pre><code>struct Base 
  {
   Base(int m_SomeValue): nSomeValue(m_SomeValue){};
   virtual ~Base(){};
   int nSomeValue;
  };
  </code></pre>
  <p>My questions is as follows</p>
  <p>#1. Should structs have virtual Destructors let alone a destructor at all?</p>
  <p>#2. Is it safe to assume that when a Struct is used as a base without a destructor that the memory allocated for it would be freed when <em>delete</em> is used on the Derived Object?</p>