我想在C++中设置一个多图:
multimap<pair<string, string>, vector<double> > mmList;
Run Code Online (Sandbox Code Playgroud)
但是如何插入数据:
mmList.insert(pair<string, string>, vector<double>("a", "b", test));
Run Code Online (Sandbox Code Playgroud) 我想知道字符串中"_"的位置:
string str("BLA_BLABLA_BLA.txt");
Run Code Online (Sandbox Code Playgroud)
就像是:
string::iterator it;
for ( it=str.begin() ; it < str.end(); it++ ){
if (*it == "_") //this goes wrong: pointer and integer comparison
{
pos(1) = it;
}
cout << *it << endl;
}
Run Code Online (Sandbox Code Playgroud)
谢谢,安德烈