two pointer point to the same refernce
i have a question about the pointers

i have two pointer , one is initialized and other not ;

now i want the second pointer that has no value ( not initialized yet ) to point to the same place in the memory .

OK , i write a small program to do this and it's work correctly


	int *P , *P2 ; 
	P = new int ; 
	P2 = new int ; 

	*P = 1 ; 
	P2 = P ; 
	cout << "P= " << *P << endl << endl ; 
	cout << "P2= " << *P2 << endl << endl ; 

	*P = 0 ;
	cout << "P2= " << *P2 << endl << endl ;  

    


the output is like this



    P = 1 ; 
    P2 = 1 ; 
    
    P2 = 0 ; 

so it work correct like i want .
Now i want to do the same but this time i want to do it using ID3D11Device *

her is the code 

	 ID3D11Device *Test ;
	 Test = Device->Get_Device() ; 
	
 
	 
	
	cout << "Test =" << Test << endl << endl ; 
	cout << "Get = " << Device->Get_Device()<< endl << endl ; 


	Device->~CL_Device();

	cout << "Test =" << Test << endl << endl ; 
	cout << "Get = " << Device->Get_Device()<< endl << endl ; 



Get_Device function definition :

    ![ID3D11Device  *const Get_Device()  const     { return  _Device ;}][1]


schema explain what i want

[enter link description here][1]


  [1]:http://i.stack.imgur.com/MwD0d.png
two pointer point to the same refernce
===

i have a question about the pointers

i have two pointer , one is initialized and other not ;

now i want the second pointer that has no value ( not initialized yet ) to point to the same place in the memory .

OK , i write a small program to do this and it's work correctly


	int *P , *P2 ; 
	P = new int ; 
	P2 = new int ; 

	*P = 1 ; 
	P2 = P ; 
	cout << "P= " << *P << endl << endl ; 
	cout << "P2= " << *P2 << endl << endl ; 

	*P = 0 ;
	cout << "P2= " << *P2 << endl << endl ;  

    


the output is like this



    P = 1 ; 
    P2 = 1 ; 
    
    P2 = 0 ; 

so it work correct like i want .
Now i want to do the same but this time i want to do it using ID3D11Device *

her is the code 

	 ID3D11Device *Test ;
	 Test = Device->Get_Device() ; 
	
 
	 
	
	cout << "Test =" << Test << endl << endl ; 
	cout << "Get = " << Device->Get_Device()<< endl << endl ; 


	Device->~CL_Device();

	cout << "Test =" << Test << endl << endl ; 
	cout << "Get = " << Device->Get_Device()<< endl << endl ; 



Get_Device function definition :

    ![ID3D11Device  *const Get_Device()  const     { return  _Device ;}][1]


schema explain what i want

[enter link description here][1]


  [1]:http://i.stack.imgur.com/MwD0d.png