A
amit kumar
I am calling a function which returns pointer to a map.
The declaration of the map is map<int,vectxyz*>. vectxyz is a vector
containing pointer to a class xyz.
For map<int,vectxyz*>* p1
In the called function, I am using p1->find(1) which is returning a
valid iterator and not going to the end. I am returning p1 from the
called function.
But in the calling function, find(1) is going to the end, i.e unable
to find the key 1, which was located in the called function.
Also p1->count(1) is showing 1 in called function whereas showing 0 in
calling function.
The pointer value is same in both calling and calld function, as I
printed them in both calling and called program.
The other map functions, say size(), begin() are working in the
calling function.
Can anyone help me and tell why the find() function is working in
called function and not in calling function.
I also tried to implement compare function (function object) for the
map but I am getting an error fatal error LNK1120: 1 unresolved
externals.
Thanks & Regards
Amit Kumar.
The declaration of the map is map<int,vectxyz*>. vectxyz is a vector
containing pointer to a class xyz.
For map<int,vectxyz*>* p1
In the called function, I am using p1->find(1) which is returning a
valid iterator and not going to the end. I am returning p1 from the
called function.
But in the calling function, find(1) is going to the end, i.e unable
to find the key 1, which was located in the called function.
Also p1->count(1) is showing 1 in called function whereas showing 0 in
calling function.
The pointer value is same in both calling and calld function, as I
printed them in both calling and called program.
The other map functions, say size(), begin() are working in the
calling function.
Can anyone help me and tell why the find() function is working in
called function and not in calling function.
I also tried to implement compare function (function object) for the
map but I am getting an error fatal error LNK1120: 1 unresolved
externals.
Thanks & Regards
Amit Kumar.