Reading from file stream using ifstream object and storing in a map
I'm having some trouble getting this to work. At first I tried to read directly into an int, std::string and double with no luck so I tried reading into character arrays and converting them to ints and std::strings with even less luck. I think this is probably not a good way to go about this and there has to be a more efficient way. Can someone help please?
load.getline(num_holder, 1, ' ');
load.getline(title_holder, 20, ' ');
Games[num_holder].title = title_holder;
Games[num_holder].hoursPlayed = hours_holder;
P.S. Posting the complete code is unnecessary but here is the definition of the std::map container I'm placing the values in just in case:
typedef std::map<int, Game> gameMap;