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

相关文章:

  • 2021-11-13
  • 2021-05-19
  • 2021-12-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-15
相关资源
相似解决方案