fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. void getArray (std::vector<std::vector<int>>& ary, int n) {
  5. ary.resize (n);
  6. for (int i = 0; i < n; i++) {
  7. ary [i].resize (i+1);
  8. }
  9. }
  10.  
  11. int main() {
  12. std::vector<std::vector<int>> ary;
  13. getArray (ary, 42);
  14. return 0;
  15. }
Success #stdin #stdout 0s 3424KB
stdin
Standard input is empty
stdout
Standard output is empty