首页 > 代码库 > 编写程序,从vector<char>初始化string

编写程序,从vector<char>初始化string

#include<iostream>#include<string>#include<vector>using namespace std;int main(){	vector<char>c = { ‘1‘, ‘2‘, ‘3‘ };	string s(c.begin(),c.end());	cout << s << endl;	return 0;}

  

编写程序,从vector<char>初始化string