fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. std::vector<int>
  7. make_vector() {
  8. std::vector<int> r(20);
  9. for(std::size_t i = 0; i != r.size(); ++i)
  10. r[i] = i*3;
  11. return r;
  12. }
  13. int main() {
  14. const auto v = make_vector();
  15. for(const auto & i : v)
  16. std::cout << i << " ";
  17. std::cout << std::endl;
  18. return 0;
  19. }
Success #stdin #stdout 0s 16048KB
stdin
Standard input is empty
stdout
0 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57