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
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. STL List

STL List

Scheduled Pinned Locked Moved ATL / WTL / STL
c++saleshelpquestion
4 Posts 4 Posters 0 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.
  • D Offline
    D Offline
    dotman1
    wrote on last edited by
    #1

    I have created a STL List customer_list with several detail properties. all works fine. However I now need to store a list of string for each customer. I have added a STL List string_list to the customer object which is accessible the problem is the data in the list is not persisted. Is it possible to have a list within a list? what could be the reason for the list not persisting the data? Regards Mark

    _ A V 3 Replies Last reply
    0
    • D dotman1

      I have created a STL List customer_list with several detail properties. all works fine. However I now need to store a list of string for each customer. I have added a STL List string_list to the customer object which is accessible the problem is the data in the list is not persisted. Is it possible to have a list within a list? what could be the reason for the list not persisting the data? Regards Mark

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

      Although it is possible to have a list within a list, it would help if you could post some relevant code. You should use the STL vector class instead of a list if you do not do insertions and deletions from the middle of the list.

      «_Superman_»  _I love work. It gives me something to do between weekends.

      _Microsoft MVP (Visual C++)

      Polymorphism in C

      1 Reply Last reply
      0
      • D dotman1

        I have created a STL List customer_list with several detail properties. all works fine. However I now need to store a list of string for each customer. I have added a STL List string_list to the customer object which is accessible the problem is the data in the list is not persisted. Is it possible to have a list within a list? what could be the reason for the list not persisting the data? Regards Mark

        A Offline
        A Offline
        Aescleal
        wrote on last edited by
        #3

        When you say persist do you mean... a) After setting up string_list the next time you look the data isn't there? b) The thing won't write to a file automatically? c) Something else! Cheers, Ash

        1 Reply Last reply
        0
        • D dotman1

          I have created a STL List customer_list with several detail properties. all works fine. However I now need to store a list of string for each customer. I have added a STL List string_list to the customer object which is accessible the problem is the data in the list is not persisted. Is it possible to have a list within a list? what could be the reason for the list not persisting the data? Regards Mark

          V Offline
          V Offline
          Vitaly Tomilov
          wrote on last edited by
          #4

          If elements in your STL list are more than just a simple type, you can wrap it up into an object, and just have STL list of objects. I used it in a few places in the following article: ProSysLib: Dissecting the Process[^]

          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