S
suresh
Hi,
I am getting zero as value for some keys in my map which can never
happen as per my understanding of my code. These are the details:
I have defined an array of vectors, where each vector element is a
map, like this:
vector<map<string,int> entry>* fulldata ;
using new operator, fulldata is memory allocated and each vector's
size is made 10 by calling resize() function.
The maps are always updated using ++fulldata[j][key_string]; This
means that no key_string in the map can have corresponding zero
integer values.
But I get bogus entries in some maps with 0 values corresponding to
some valid key_string.
How can this happen? Interestingly this problem is noticed in the maps
stored in the 2nd position in the vector (for many vectors it is
seen). ie fulldata[2][key_string] is zero for many i values.
I am using debian etch with g++ version 4:4.1.1-15.
Thanks for any suggestions,
suresh
I am getting zero as value for some keys in my map which can never
happen as per my understanding of my code. These are the details:
I have defined an array of vectors, where each vector element is a
map, like this:
vector<map<string,int> entry>* fulldata ;
using new operator, fulldata is memory allocated and each vector's
size is made 10 by calling resize() function.
The maps are always updated using ++fulldata[j][key_string]; This
means that no key_string in the map can have corresponding zero
integer values.
But I get bogus entries in some maps with 0 values corresponding to
some valid key_string.
How can this happen? Interestingly this problem is noticed in the maps
stored in the 2nd position in the vector (for many vectors it is
seen). ie fulldata[2][key_string] is zero for many i values.
I am using debian etch with g++ version 4:4.1.1-15.
Thanks for any suggestions,
suresh