Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. when should i use a list and when to use vector?

when should i use a list and when to use vector?

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsdockerquestion
4 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cpp_Com
    wrote on last edited by
    #1

    Hi All I've a doubt. when should we use a vector, when to use list and when we should go for map container in our programming? Thank you all.

    _ C 2 Replies Last reply
    0
    • C Cpp_Com

      Hi All I've a doubt. when should we use a vector, when to use list and when we should go for map container in our programming? Thank you all.

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      It's easy to differentiate the use of the three containers you mentioned in your query. Just read the documentation for the containers in MSDN

      You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

      C 1 Reply Last reply
      0
      • _ _AnsHUMAN_

        It's easy to differentiate the use of the three containers you mentioned in your query. Just read the documentation for the containers in MSDN

        You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_

        C Offline
        C Offline
        Cpp_Com
        wrote on last edited by
        #3

        I tried searching on google, but could not find a satisfactory answer. :)

        1 Reply Last reply
        0
        • C Cpp_Com

          Hi All I've a doubt. when should we use a vector, when to use list and when we should go for map container in our programming? Thank you all.

          C Offline
          C Offline
          carter2000
          wrote on last edited by
          #4

          If you need random access operation frequently in your code, use vector. If you need insert and delete operation frequently, use list. And map should be use when you want to identify a value by a key(mobbish).

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups