Horje
vectors in c++ Code Example
vectors c++
#include <iostream>
#include <vector>
 
using namespace std;

int main()
{
    // Create a vector containing integers
   vector<int> v = { 7, 5, 16, 8 };
 
    v.push_back(25); // Adds 25 to the contents of the vector 
    v.push_back(13); // Adds 13 to the contents of the vector
 
    // Print out the contents of the vector
    cout << "v = { ";
    for (int n : v) {
        std::cout << n << ", ";
    }
    cout << "}; \n";
}
vectors in c++
vector <int> vc;




Cpp

Related
if else in C++ Code Example if else in C++ Code Example
how to input in cpp Code Example how to input in cpp Code Example
return array of string in function c++ Code Example return array of string in function c++ Code Example
REFERENCE C++ Code Example REFERENCE C++ Code Example
c++ convert int to double Code Example c++ convert int to double Code Example

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