SyntaxFix
Write A Post
Hire A Developer
Questions
You need a back inserter to copy into vectors:
std::copy(str.c_str(), str.c_str()+str.length(), back_inserter(data));