1 / 13
Jan 2011

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???

  • created

    Jan '11
  • last reply

    Feb '11
  • 12

    replies

  • 298

    views

  • 2

    users

  • 1

    link

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 ... smile

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 >

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 13 6d

Want to read more? Browse other topics in C and C++ or view latest topics.