I am trying to figure out a way to use maps to keep a total number of items.

I was using arrays before

total[x] = total[x] + (function to add another int);

Now I made total a map, but have no idea how to get the same result.

Gives me an error.


Any help would be greatly appreciated.

I am trying to figure out a way to use maps to keep a total number of items.

I was using arrays before

total[x] = total[x] + (function to add another int);

Now I made total a map, but have no idea how to get the same result.

Gives me an error.


Any help would be greatly appreciated.

Where is a map?
You need to get this milk before you start chewing!