fork download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. vector vec;
  8. vec.resize(3);
  9. vec.reserve(10);
  10. vec.push_back(2);
  11. int a = vec.size();
  12. cout<< a;
  13. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:7:9: error: missing template arguments before ‘vec’
  vector vec;
         ^~~
prog.cpp:8:1: error: ‘vec’ was not declared in this scope
 vec.resize(3);
 ^~~
stdout
Standard output is empty