fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. double mas [10] = {1.29, 3.23, 7.98, 5.54, 8.32, 2.48, 7.1};
  6. double * p1;
  7. p1 = & mas [0];
  8. for(int i=0;i<10;i++)
  9. {
  10. p1 = & mas [i];
  11. cout<<mas[i]<<" "<<p1<<endl;
  12. }
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5268KB
stdin
Standard input is empty
stdout
1.29 0x7ffcb1f3a630
3.23 0x7ffcb1f3a638
7.98 0x7ffcb1f3a640
5.54 0x7ffcb1f3a648
8.32 0x7ffcb1f3a650
2.48 0x7ffcb1f3a658
7.1 0x7ffcb1f3a660
0 0x7ffcb1f3a668
0 0x7ffcb1f3a670
0 0x7ffcb1f3a678