Hey I was just wondering if there was any way to implement a system where you can say somehthing like:
Add "Rambo" 5
And that would save and then you could say
Get "Rambo"
and it would return
Rambo has a rating of 5
and then if you wanted to remove it you would say:
Remove "Rambo"
Can you not suggest a way to create a system like this?
i have been trying to implement it through adding a linked list but it just keeps giving me wrong output
you can use std::map<std::string,int> to hold the data. write a loop where in each iteration you get a string command. use a switch control structure to check the input. if the command is "quit" you stop the program. if the command is "get" or "remove" you read one more string which is the parameter for the command. if the command is "add" you read one more string and an int.
Hmm... I would suggest using two separate maps for holding the command->enum association and the title->rating association... I hope the following helps: