Multidimesional maps, vectors and iterators

Discussion in 'C Programming' started by Sheep, Aug 6, 2006.

  1. Sheep

    Sheep

    Joined:
    Aug 6, 2006
    Messages:
    2
    I've got a problem:

    I declared the map as
    std::map<int, std::vector<SDL_Surface*> > surfaces;

    The map is for layer 1, layer 2, etc. The vector inside contains the surfaces...
    Now I have an iterator:

    std::map<int, std::vector<SDL_Surface*> >::iterator curLayer = surfaces.begin();

    Then I have another iteraror:
    std::vector<SDL_Surface*>::iterator curItem;

    Now this line generates an error:
    curItem = (*curLayer).begin();

    The error is a long sentence with the end 'does not contain a member named begin()'

    Does anyone know how to solve this?

    Greetz,
    Vincent
     
    Sheep, Aug 6, 2006
    #1
    1. Advertising

  2. Sheep

    Sheep

    Joined:
    Aug 6, 2006
    Messages:
    2
    Someone.... Help.... Please?
     
    Sheep, Aug 14, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Elliott
    Replies:
    4
    Views:
    1,190
    Simon Elliott
    Mar 10, 2005
  2. LeTubs
    Replies:
    1
    Views:
    307
    Jonathan Mcdougall
    Dec 5, 2005
  3. Marcus
    Replies:
    2
    Views:
    620
    Marcus
    Dec 9, 2005
  4. jschon@umich.edu

    Maps, Iterators and Templated Classes

    jschon@umich.edu, Jul 28, 2006, in forum: C++
    Replies:
    4
    Views:
    291
    Thorsten Kiefer
    Jul 29, 2006
  5. Edward Liu
    Replies:
    6
    Views:
    183
    Andre Nathan
    Jan 14, 2008
Loading...

Share This Page