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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.