title: Two pointers point to the same refernce
body: <p>I have a question about the pointers</p>
  
  <p>I have two pointers, one is initialized and the other is not;</p>
  
  <p>Now i want the second pointer that has no value (is not initialized yet) to point to the same place in the memory.</p>
  
  <p>OK, i wrote a small program to do this and it works correctly</p>
  
  <pre><code>int *P , *P2 ; 
  P = new int ; 
  P2 = new int ; 
  
  *P = 1 ; 
  P2 = P ; 
  cout &lt;&lt; "P= " &lt;&lt; *P &lt;&lt; endl &lt;&lt; endl ; 
  cout &lt;&lt; "P2= " &lt;&lt; *P2 &lt;&lt; endl &lt;&lt; endl ; 
  
  *P = 0 ;
  cout &lt;&lt; "P2= " &lt;&lt; *P2 &lt;&lt; endl &lt;&lt; endl ;  
  </code></pre>
  
  <p>The output is like this:</p>
  
  <pre><code>P = 1 ; 
  P2 = 1 ; 
  
  P2 = 0 ; 
  </code></pre>
  
  <p>So it work correct like i want.</p>
  
  <p>Now i want to do the same but this time i want to do it using <code>ID3D11Device *</code></p>
  
  <p>Here is the code:</p>
  
  <pre><code> ID3D11Device *Test ;
   Test = Device-&gt;Get_Device() ; 
  
  
  cout &lt;&lt; "Test =" &lt;&lt; Test &lt;&lt; endl &lt;&lt; endl ; 
  cout &lt;&lt; "Get = " &lt;&lt; Device-&gt;Get_Device()&lt;&lt; endl &lt;&lt; endl ; 
  
  
  Device-&gt;~CL_Device();
  
  cout &lt;&lt; "Test =" &lt;&lt; Test &lt;&lt; endl &lt;&lt; endl ; 
  cout &lt;&lt; "Get = " &lt;&lt; Device-&gt;Get_Device()&lt;&lt; endl &lt;&lt; endl ; 
  </code></pre>
  
  <p>Get_Device function definition :</p>
  
  <pre><code>![ID3D11Device  *const Get_Device()  const     { return  _Device ;}][1]
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/MwD0d.png" rel="nofollow">schema</a> explaining what i want.</p>