Multidimesional maps, vectors and iterators

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

  1. Sheep

    Sheep

    Joined:
    Aug 6, 2006
    Messages:
    2
    Likes Received:
    0
    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. Advertisements

  2. Sheep

    Sheep

    Joined:
    Aug 6, 2006
    Messages:
    2
    Likes Received:
    0
    Someone.... Help.... Please?
     
    Sheep, Aug 14, 2006
    #2
    1. Advertisements

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,384
    Simon Elliott
    Mar 10, 2005
  2. Marcin Kaliciñski

    Iterators and reverse iterators

    Marcin Kaliciñski, May 8, 2005, in forum: C++
    Replies:
    1
    Views:
    720
    Kai-Uwe Bux
    May 8, 2005
  3. LeTubs
    Replies:
    1
    Views:
    426
    Jonathan Mcdougall
    Dec 5, 2005
  4. Marcus
    Replies:
    2
    Views:
    780
    Marcus
    Dec 9, 2005
  5. jschon@umich.edu

    Maps, Iterators and Templated Classes

    jschon@umich.edu, Jul 28, 2006, in forum: C++
    Replies:
    4
    Views:
    405
    Thorsten Kiefer
    Jul 29, 2006
  6. John
    Replies:
    3
    Views:
    398
  7. Guest
    Replies:
    0
    Views:
    652
    Guest
    Sep 14, 2005
  8. Edward Liu
    Replies:
    6
    Views:
    272
    Andre Nathan
    Jan 14, 2008
Loading...