fork download
  1. #include <vector>
  2. std::vector<int> get_stuff( int how_many, std::vector<int> pre_buff = std::vector<int>() ) {
  3. pre_buff.clear();
  4. for (int i = 0; i < how_many; ++i)
  5. pre_buff.push_back(i);
  6. // blah blah
  7. return pre_buff;
  8. }
  9. #include <iostream>
  10. int main() {
  11. auto v = get_stuff(7);
  12. for (auto x:v)
  13. std::cout << x << "\n";
  14. }
Success #stdin #stdout 0s 2984KB
stdin
Standard input is empty
stdout
0
1
2
3
4
5
6