User Profile

Collapse

Profile Sidebar

Collapse
hagdanan
hagdanan
Last Activity: May 18 '10, 04:22 AM
Joined: Apr 28 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • hagdanan
    replied to STL map.find problem in using a compare class
    in C
    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?...
    See more | Go to post

    Leave a comment:


  • hagdanan
    replied to STL map.find problem in using a compare class
    in C
    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...
    See more | Go to post

    Leave a comment:


  • hagdanan
    started a topic STL map.find problem in using a compare class
    in C

    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
    ...
    See more | Go to post
    Last edited by Banfa; Apr 28 '10, 08:26 AM. Reason: Added [code]...[/code] tags
No activity results to display
Show More
Working...