Answers for "check element in set c++"

C++
1

check if set contains element c++

set<T>::iterator it = theSet.find(element);
if (it != theSet.end())
{
  // The element was found
}
else
{
  // The element was not found
}
Posted by: Guest on May-21-2021

Browse Popular Code Answers by Language