Wich iterator best suit my needs?

This is a discussion on Wich iterator best suit my needs? within the C++ Programming forums, part of the General Programming Boards category; I can't make up my mind on wich would be the best one. I am learning teaching by myself so ...

  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    6

    Wich iterator best suit my needs?

    I can't make up my mind on wich would be the best one. I am learning teaching by myself so I don't have anyone to ask exept you (thank God there is good people on the net).
    I am planning to translate a project I did in C in C++ using C++ powerful devices.
    The programm helps managing a list of invited people (users) and manage their confirmation and stuff, so in C I had used a dynamic allocated list of structs. The programm also saved the data onto a file so as not to loose them every run.
    Now i thought that in C++ it would be easier to use classes in place of structs, and now I am wondering how to organize the User Objects.
    Vector or List (or Deque)?
    My main needs will be:
    1) Add new user
    2) View users' list
    3) Modify user, therefore also being able to search for it (for long lists)
    4) Count confirmations
    5) Order them (may be usefull confirmation or name order)

    The list is probably gonna have a size of 50-300 users. I was afraid that the list way would have been stupid for accessing the users (i know 200 is nothing to moder PCs, but theoretically speaking...) while vector was probably better for acces due to its [].
    On the other hand list manage the data better on the ordering stuff, doesn't it?

    What do you advice?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,461
    It looks like std::vector will do.

    Quote Originally Posted by AscanioFX
    The programm also saved the data onto a file so as not to loose them every run.
    As a further exercise, you could consider using SQLite or a similiar zero configuration embedded database engine.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Dec 2012
    Posts
    6
    The fact is that I don'y know anything about databases. I know they are dead usefull, but this programm is already an exercise for my C++ skills

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Connecting input iterator to output iterator
    By QuestionC in forum C++ Programming
    Replies: 2
    Last Post: 04-10-2007, 02:18 AM
  2. Making an MFC form to suit
    By TJJ in forum Windows Programming
    Replies: 1
    Last Post: 04-17-2004, 11:20 AM
  3. M$ phone suit
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 20
    Last Post: 12-26-2002, 04:58 PM
  4. would a class suit?
    By DMaxJ in forum C++ Programming
    Replies: 5
    Last Post: 09-26-2002, 01:16 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21