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. Set in Visual Studio 2005!

Set in Visual Studio 2005!

Scheduled Pinned Locked Moved ATL / WTL / STL
c++csharpvisual-studiotutorialquestion
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.
  • S Offline
    S Offline
    SanjaySMK
    wrote on last edited by
    #1

    Hello, How to use the STL set in C++ in Visual Studio 2005? thanks and regards,

    Software Developer Sanjay Khapre

    S 1 Reply Last reply
    0
    • S SanjaySMK

      Hello, How to use the STL set in C++ in Visual Studio 2005? thanks and regards,

      Software Developer Sanjay Khapre

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      #include <set> #include <iostream> int main(int, char**) { // Create an integer set and initialise it std::set<int> a_set; a_set.insert(10); a_set.insert(1); a_set.insert(4); a_set.insert(7); // This should say 8 is NOT in the set if (a_set.find(8) != a_set.end()) std::cout << "8 is in the set" << std::endl; else std::cout << "8 is NOT in the set" << std::endl; // This should say 7 is in the set if (a_set.find(7) != a_set.end()) std::cout << "7 is in the set" << std::endl; else std::cout << "7 is NOT in the set" << std::endl; // Remove 7 from the set a_set.erase(7); // This should say 7 is NOT in the set if (a_set.find(7) != a_set.end()) std::cout << "7 is in the set" << std::endl; else std::cout << "7 is NOT in the set" << std::endl; } HTH!!!

      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