This is a sample code i have, can anyone guide me how do i solve this problem, i have read alot of maps, but i need help on how to get it right.
Code:
// There is Apple class
//Fruit.h
std::map<std::string,Apple> apples;
// I have this method in, Fruit.cpp
//Fruit.cpp
//have to use insert() method of map
void Fruit::addApple(const Apple& a){
apples.insert(std::pair<string, Apple>);
// error: expected primary-expression before ')' token
//create apple and use 'other' addApple method
void Fruit::addApple(const string id, const int duration){
Apple(id, duration);
addApple(Apple);
// error: expected primary-expression before ')' token