title: Assign pointer to iterator
body: <p>I need to deallocate and then allocate a pointer in the vector iterator . Is it Ok to assign a pointer to iterator as given below?</p>
  
  <pre><code>   VEC_SECS m_vec;
     m_vec.push_back(new CSecs);       
     VEC_SECS::iterator iter = m_vec.begin();
  
     for (iter ; iter != m_vec.end(); ++iter)
     {
            CSecs *p = *iter;
            delete p;         
            p = new CSecs;
            *iter = p;
     }
  </code></pre>