fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main () {
  5. double *p,*q;
  6. double i=2.3, k =4.3;
  7. p=new double[2];
  8. *p=i; q=p;
  9. std::cout<<*p<<" "<<*q<<std::endl;
  10. i=8.4;
  11. cout<<*p; p[1]=i; i=5.2;
  12. cout<<" "<<*p<<endl;
  13. *q=k;
  14. cout<<p[0]<<" "<<*q<<p[1]<<endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
2.3 2.3
2.3 2.3
4.3 4.38.4