fork(7) download
  1. #include <utility>
  2. #include <iostream>
  3. std::pair<double,double> * pairArr;
  4. int main(){
  5. pairArr = new std::pair<double,double> [3]; //creating the array
  6.  
  7. pairArr [0] = std::make_pair(1.0,1.2); //Filling arbitrary numbers
  8. pairArr [1] = std::make_pair(0.2,1.4);
  9. pairArr [2] = std::make_pair(0.8,1.3);
  10.  
  11. std::cout << pairArr[0].first << pairArr[1].second << pairArr[2].first;
  12. return 0;
  13. }
Success #stdin #stdout 0s 2856KB
stdin
Standard input is empty
stdout
11.40.8