Horje
C++ to specify size and value Code Example
C++ to specify size and value
// CPP program to create an empty vector
// and push values one by one.
#include <iostream>
#include <vector>
using namespace std;
 
int main()
{
    int n = 3;
 
    // Create a vector of size n with
    // all values as 10.
    vector<int> vect(n, 10);
 
    for (int x : vect)
        cout << x << " ";
 
    return 0;
}




Cpp

Related
geekforgeeks stacks Code Example geekforgeeks stacks Code Example
c++ program to print odd numbers using loop Code Example c++ program to print odd numbers using loop Code Example
c++ program to convert celsius to fahrenheit Code Example c++ program to convert celsius to fahrenheit Code Example
maximum subarray leetcode c++ Code Example maximum subarray leetcode c++ Code Example
how to setup glut main loop Code Example how to setup glut main loop Code Example

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