Thanks a lot.
but I am wondering about the effect of the Sort class on the find method. I need to return false so that find will work?...
User Profile
Collapse
-
Because sometimes we use keys that are not in integer form. And map do sort the keys when we insert on it, so if I use keys as "1", "2", "3", "10".. this will not be arrange numerically(sin ce its string) as expected to be 1, 2, 3 and 10.. but this will be arranged alphabetically as "1", "10","2","3 ". That's why I have this class to check if the string can be converted...Leave a comment:
-
STL map.find problem in using a compare class
Hi all, I am new to STL and I have a problem with my map. I made a class(Sort) for comparison on the map but the problem is map.find will not work.
Can someone explain why find was not able to locate the key?
here is the code:
Code:#include<iostream> #include<map> #include<string> using namespace std; class Sort { public: bool
No activity results to display
Show More
Leave a comment: