deleting an array that stores pointers to some objects
<p>I am storing pointers to elements of a vec_A in an array <code>A* a_ptrs[3]</code>  .  Assume that vec_A will not be resized. So, <code>a_ptrs[i]</code> will point to the correct element.</p>

<p>My question is: </p>

<p>Suppose A* a_ptrs[3] is declared in a <code>class B</code>. Since it is not created using 'new' I am guessing I don't need to delete it in the destructor. Am I right??</p>

<pre><code>class A {
      public:                       
             int getNumber();            
             A(int val);
             ~A(){};
      private:
              int num;
};    
A::A(int val){
         num = val;
         };             
int A::getNumber(){
    return num;
};

 int main(){  
    int i  =0;
    int num;    
    std::vector&lt;A&gt; vec_A;
    for ( i = 0; i &lt; 10; i++){
        vec_A.push_back(A(i));
        }

    A* a_ptrs[3];        
    a_ptrs[0] = &amp;vec_A[0];        
    a_ptrs[1] = &amp;vec_A[3];        
    a_ptrs[2] = &amp;vec_A[5];

    for (i = 0; i&lt;3; i++){
        std::cout&lt;&lt;"\n: a_ptrs[i].getNumber() = "&lt;&lt;a_ptrs[i]-&gt;getNumber();
    }        
    std::cout &lt;&lt; "\nPress RETURN to continue...";
    std::cin.get();    
    return 0;
}
</code></pre>
