i have declared the following as global
map h;map x;
i want to re intialize all of the values in a map to zero how to do it please help???
cplusplus.com/reference/stl/map/
sir can u please write the code snippet.... plz.
somebody plz reply...
Everything you need is on that page.
Give a man a fish he'll eat for a day. Teach a man to fish and he'll never go hungry.
Sir i am not getting it... i will learn fishing next time ...
Did you even read the page?
is it map.clear();
Of course.
Technically it won't reset the values to zero, but it will serve the same purpose.
thank u sir..... for ur help..
I have another ques though...
can we have 2D map declaration's and initializations..i think that would be quite helpful for memoization for [10^9][10^9] dimensions as we clearly cannot make 2d array in c that big..
Sure you can.
I would make sure that map is goin to be populated sparsely or you will get a runtime error. I would question he solution that used this method however, there may be a simpler way.
is it given in the link which u gave me.... i.e how to make a 2d map
You simply create the nested map as the value of the first map.
Map >