C++ is an enhanced C language typically used for object oriented programming. It traces its origins back well over thirty years. Although it’s far from the oldest computer language, it’s one of the older ones that is in common usage today – so you might say it gets an A for its ability to adapt to changing technological times.


Posted by chris on: 2020-12-30, Category: C++

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value of the element cannot be modified once it is added to the set, though it is possible to remove and add the modified value of that element. Some basic functions associated with Set:

  • begin() – Returns an iterator to the first element in the set.
  • end() – Returns an iterator to the theoretical element that follows last element in the set.
  • size() – Returns the number of elements in the set.
  • max_size() – Returns the maximum number of elements that the set can hold.
  • empty() – Returns whether the set is empty.
2020-12-30
Set in C++ Standard Template Library (STL)

Sets are a type of associative containers in which each element has to be unique, because the value of the element identifies it. The value of the element cannot be modified once it is added to the set, though it is possible to remove and add the modified value of that element. Some basic functions associated with Set:

  • begin() – Returns an iterator to the first element in the set.
  • end() – Returns an iterator to the theoretical element that follows last element in the set.
  • size() – Returns the number of elements in the set.
  • max_size() – Returns the maximum number of elements that the set can hold.
  • empty() – Returns whether the set is empty.