c++ vector init操作

1)

string   str[n]={"hello", ...};
vector<string> strArray(str,str+n);

2)

vector<string> strArray;
strArray.push_back("hello");
strArray.push_back("world");

ref:  http://bbs.csdn.net/topics/360083770

原文地址:https://www.cnblogs.com/pinganzi/p/6497414.html