fork download
  1. #include <vector>
  2. #include <iostream>
  3.  
  4. int getInt() {
  5. return 42;
  6. }
  7.  
  8. int main() {
  9. std::vector<int> v;
  10. v.assign(100, getInt());
  11. std::cout << v.size() << std::endl;
  12. return 0;
  13. }
Success #stdin #stdout 0s 4532KB
stdin
Standard input is empty
stdout
100