vector init c++

#include <iostream>
#include <vector>

int main() {
    // Step 1: Include necessary headers
    #include <iostream>
    #include <vector>

    // Step 2: Declare a vector using the template class
    std::vector<int> myVector;

    // Step 3: Initialize the vector with values using initializer list
    std::vector<int> initializedVector = {1, 2, 3, 4, 5};

    // Step 4: Initialize a vector with a specific size and default value
    std::vector<int> sizedVector(5, 10);

    // Step 5: Initialize a vector with values from another vector
    std::vector<int> copiedVector(initializedVector.begin(), initializedVector.end());

    // Step 6: Display the elements of a vector
    for (int element : initializedVector) {
        std::cout << element << " ";
    }

    return 0;
}