Thread: Vectors

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Quote Originally Posted by Bubba
    Also in vectors do NOT erase() the first element of the vector. If the vector has an odd number of members there is a specific way you must erase them. I've encountered this in my recent project and it is quite annoying.
    Hmmm, you mean this doesn't work?
    It should:
    Code:
    vec.erase(vec.begin(),vec.begin()+1);
    //or
    vec.erase(vec.begin());
    Last edited by Sang-drax; 11-27-2004 at 10:04 AM.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Vectors
    By naseerhaider in forum C++ Programming
    Replies: 11
    Last Post: 05-09-2008, 08:21 AM
  2. How can i made vectors measuring program in DevC++
    By flame82 in forum C Programming
    Replies: 1
    Last Post: 05-07-2008, 02:05 PM
  3. How properly get data out of vectors of templates?
    By 6tr6tr in forum C++ Programming
    Replies: 4
    Last Post: 04-15-2008, 10:35 AM
  4. How to use Vector's in C++ !?!
    By IndioDoido in forum C++ Programming
    Replies: 3
    Last Post: 10-14-2007, 11:13 AM
  5. Points, vectors, matrices
    By subnet_rx in forum Game Programming
    Replies: 17
    Last Post: 01-11-2002, 02:29 PM