我正在尝试读取csv文件并将其存储在C++的HashMap中。这是我的代码。在C++中将csv读入unordered_map
void processList(std::string path, std::unordered_map<std::string, int> rooms){
std::ifstream openFile(path);
std::string key;
int value;
std::getline(openFile, key, ','); //to overwrite the value of the first line
while(true)
{
if (!std::getline(openFile, key, ',')) break;
std::getline(openFile, value, '\n');
rooms[key] = value;
std::cout << key << ":" << value << std::endl;
}
}
我不断收到以下错误
error: no matching function for call to 'getline'
std::getline(openFile, value, '\n');
我在做什么错。