Horje
vectors 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";
}




Cpp

Related
why convert char* to string c++ Code Example why convert char* to string c++ Code Example
remove specific element from vector c++ Code Example remove specific element from vector c++ Code Example
strip whitespace c++ Code Example strip whitespace c++ Code Example
split pdf Code Example split pdf Code Example
switch statement Code Example switch statement Code Example

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