#include <iostream> #include <vector> using namespace std; int main() { vector vec; vec.resize(3); vec.reserve(10); vec.push_back(2); int a = vec.size(); cout<< a; }
Standard input is empty
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); ^~~
Standard output is empty