Answers for "vector init c++"

C++
0

vector init c++

#include <bits/stdc++.h>
using namespace std;

int main(){
  vector<int> a(10,0);		//init a vector with 10 zero's
  vector<int> b{1,2,3};		//init a vector with values 1,2,3
  vector<int> c(5);			//init a vector with length 10
  vector<int> d;			//init a vector
}
Posted by: Guest on January-23-2022

Browse Popular Code Answers by Language