fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. double val[3] = {-3.1415, 6.2430, +37};
  6.  
  7. // Declare and initialize pointer variable:
  8. double * pointer = val;
  9. cout << "Elements of the array are: " << endl;
  10. cout << pointer[0] << " " << pointer[1] << " " << pointer[2] << endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 5296KB
stdin
Standard input is empty
stdout
Elements of the array are: 
-3.1415 6.243 37