fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <array>
  4.  
  5. int main() {
  6. using namespace std;
  7. using ad = array<double, 2>;
  8.  
  9. double a[][2] = { {1,2}, {3,4} };
  10. constexpr int length = (sizeof(a)/sizeof(ad));
  11.  
  12. // やっちゃだめだゾ!
  13. vector<ad> v((ad*)a,(ad*)(a+length));
  14.  
  15. for( auto d: v )
  16. cout << "(" << d[0] << "," << d[1] << "), ";
  17.  
  18. cout << endl;
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
(1,2), (3,4),