fork(1) download
  1. #include<iostream>
  2. #include<vector>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. const vector<int> a{ 1,2,3,4,5,6,7,8,9 };
  9. const int sz = a.size();
  10. int b[sz];
  11. auto it = a.cbegin();
  12. for (auto &i : b)
  13. {
  14. i = *it;
  15. cout << i << " ";
  16. it++;
  17. }
  18.  
  19. cout << endl;
  20. return 0;
  21. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
1 2 3 4 5 6 7 8 9