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. COM
  4. STL: How can I delete a <list>...

STL: How can I delete a <list>...

Scheduled Pinned Locked Moved COM
questionc++helptutorial
2 Posts 2 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.
  • B Offline
    B Offline
    Braulio Dez
    wrote on last edited by
    #1

    Hi !, I´m new using this STL, now I can add members to a list an iterate though that list, but ... still don´t now how to delete members from it, and free the list in a right way... Can anybody help me ? Thanks a lot,Bye ! Braulio X|

    M 1 Reply Last reply
    0
    • B Braulio Dez

      Hi !, I´m new using this STL, now I can add members to a list an iterate though that list, but ... still don´t now how to delete members from it, and free the list in a right way... Can anybody help me ? Thanks a lot,Bye ! Braulio X|

      M Offline
      M Offline
      MikeG 0
      wrote on last edited by
      #2

      ****From answer in C++ section**** To clear the whole list: list.erase( list.begin(), list.end() ); To delete a single item: // iter is the iterator of the item you want to delete // iter = list.begin(); // 1st item in list // iter = &(list.at(iIndex)); //iItem in lsi list.erase( iter ); Hope this helps Mike

      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