Code has been added to clipboard!

Initializing C++ Vector by Copying from Another Vector

Example
#include <iostream>
#include <string>
#include <vector>

int main() {
    std::vector < std::string > vecOfStr;
    vecOfStr.push_back("first");
    vecOfStr.push_back("sec");
    vecOfStr.push_back("third");
    // Vector with other string object
    std::vector < std::string > vecOfStr3(vecOfStr);
}