3

How can I define sets in C++ and insert values into them?

hivert
  • 10,579
  • 3
  • 31
  • 56
Bahareh
  • 59
  • 7

1 Answers1

16

Use the std::set class in <set>.

std::set<int> s; // define a set of ints
s.insert(1);     // insert into a set
moinudin
  • 134,091
  • 45
  • 190
  • 216