精華區beta EE_DSnP 關於我們 聯絡資訊
map<string, int> scores; pair<map<string, int>::iterator, bool> p = scores.insert(make_pair(“John”, 100)); 上面的是更正的版本 而我之前查了一些資料 有人寫成 map<string, int> scores; pair<map<string, int>::iterator, bool> p = scores.insert(pair(“John”, 100)); 或是 map<string, int> scores; pair<map<string, int>::iterator, bool> p = scores.insert(map<string, int>::value_type(“John”, 100)); 不知道上面幾種寫法有什麼不一樣呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.109.223.18