title: After delete,why object pointer can still be manipulated?
body: <p>I have some very interesting code snippets. When I delete a object, its value become zero, but the object pointer can still be manipulated, is this wierd?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  using namespace std;
  
  class B
  {
  public:
    vector&lt;double&gt; vec;
  };
  
  class A 
  { 
  public:
    B b;
  };
  
  int main()
  {
    A* a = new A();
  
    a-&gt;b.vec.push_back(1);
    a-&gt;b.vec.push_back(2);
  
    A* a1;
  
    delete a;
  
    cout &lt;&lt; "before" &lt;&lt; endl;
    a1= a;
  
    cout &lt;&lt; a1-&gt;b.vec[0] &lt;&lt; endl;
    cout &lt;&lt; "after" &lt;&lt; endl;
  
    return 0;
  }
  </code></pre>
  
  <p><strong>output:</strong></p>
  
  <pre><code>before
  0
  after
  </code></pre>
  
  <p>After I delete a, its value become zero, but it still can be referenced? I don't know why?</p>