<分区>
我找不到这个问题的答案,如有重复,请提前致歉。
有没有更优雅的方式来创建 vector<char>
来自string
.
std::string s("I'm afraid. I'm afraid, Dave.");
std::vector<char> temp;
for (size_t x = 0; x < s.size(); x++)
{
temp.push_back(s[x]);
}
谢谢