What is difference between vector v(10) and vector v[10]?
Answers
Answered by
0
vector<int> v(n)
It defines a vector with size = n
cout << "Enter a number :";
cin >> n;
vector <int> v1(n);
for(int i = 0; i < v1.size(); i++ )
cout << v1[i];
Output
.................
It defines a vector with size = n
cout << "Enter a number :";
cin >> n;
vector <int> v1(n);
for(int i = 0; i < v1.size(); i++ )
cout << v1[i];
Output
.................
Similar questions