char 转 stringchar* 转 string char 转 string// 使用string类的构造函数,s被初始化为1个'c'string s = string(1,'c'); // s="c"// string s2 = string(3, 'A'); // s2 = "AAA" char* 转 stringchar* s = "abcd";string str1 = s;string str2(s);