Map iteration

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarkoKlacar
    Recognized Expert Contributor
    • Aug 2007
    • 296

    Map iteration

    Hi,

    I have following problem.

    I have a map looking like this:
    Code:
    map<char,Action*> shortkeys
    Now what I want to do is read a char and check if the map - shortkeys - contains that char. I've played around with loops and iterators but nothing works, I get some error about a non-scalar type.

    What is the fastest way of doing what I want to do, and how should I do it?

    Thanks!
  • mac11
    Contributor
    • Apr 2007
    • 256

    #2
    maps have a find() method that should accomplish what you need http://www.cplusplus.com/reference/stl/map/

    Comment

    • MarkoKlacar
      Recognized Expert Contributor
      • Aug 2007
      • 296

      #3
      Hi,

      Hi that's what I ended up using.

      Cheers for that!

      Comment

      Working...