-1
如何打印多圖的矢量? 例如我有看起來像這樣的載體:打印地圖矢量
typedef std::multimap<double,std::string> resultMap;
typedef std::vector<resultMap> vector_results;
EDIT
for(vector_results::iterator i = vector_maps.begin(); i!= vector_maps.end(); i++)
{
for(vector_results::iterator j = i->first.begin(); j!= i->second.end(); j++)
{
std::cout << j->first << " " << j->second <<std::endl;
}
}
至少給它一個去,所以我們有東西上工作,你不能解決你的特殊問題。 – 2013-03-07 00:26:33
@EdHeal:我其實是。 (vector_results :: iterator i = vector_maps.begin(); i!= vector_maps.end(); i ++){vector_results :: iterator j = i-> first.begin() ); j!= i-> second.end(); j ++){ \t std :: cout << j-> first << " " << j-> second << std :: endl; \t } \t \t } [漂亮地打印C++ STL容器]的' – 2013-03-07 00:27:12
可能重複(http://stackoverflow.com/questions/4850473/pretty-print-c-stl-containers) – ildjarn 2013-03-07 00:27:24