I need help with inserting a string for both key and value to a map.
error:
error: conversion from `std::_Rb_tree_ iterator<std::p air<const std::string, std::string> >' to non-scalar type `std::_Rb_tree_ iterator<std::p air<const std::string, int> >' requested
can you please help me with this.
thanks
drjay
Code:
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: conversion from `std::_Rb_tree_ iterator<std::p air<const std::string, std::string> >' to non-scalar type `std::_Rb_tree_ iterator<std::p air<const std::string, int> >' requested
can you please help me with this.
thanks
drjay
Comment