Horje
initialize all elements of vector to 0 c++ Code Example
initialize all elements of vector to 0 c++
 vector<int> vect1(10); //number of elements in vector
    int value = 0;
    fill(vect1.begin(), vect1.end(), value);
how to initialize vector in c++ with all elements 0
 vector<int> arr(10,0);
initialize all elements of vector to 0 c++
// Create a vector of size n with
    // all values as 10.
    vector<int> vect(n, 10);




Cpp

Related
cpp sample code Code Example cpp sample code Code Example
c++ print byte as bit Code Example c++ print byte as bit Code Example
initialize 2d array c++ memset Code Example initialize 2d array c++ memset Code Example
c++ code for quicksort Code Example c++ code for quicksort Code Example
how to hide the c++ console Code Example how to hide the c++ console Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8