I need help with inserting a string for both key and value to a map.
while(!myHuffFile.eof()){
string word, code;
int freq;
myHuffFile >> word >> freq >> code;
if(word == ""){
break;
}else{
_fileMap.insert(pair<string,string>(word,code));
_freqMap.insert(pair<string,int>(word,freq));
}
}
error:
error: conversion from `std::_Rb_tree_iterator<std::pair<const std::string, std::string> >' to non-scalar type `std::_Rb_tree_iterator<std::pair<const std::string, int> >' requested
can you please help me with this.
thanks
drjay