The _Find_next() is a built-in function in C++ Biteset class which returns an integer which refers the position of next set bit in bitset after index. If there isn’t any set bit after index, _Find_next(index) will return the size of the bitset.
iterator bitset._Find_next(index) or int bitset._Find_next(index)
Parameters: The function accepts one mandatory parameter index which specifies the index after which the first set bit is to be found in the bitset.
Return Value: The function returns an integer which refers to the position of next set bit in bitset after specified index. If there isn’t any set bit after index(the specified index), _Find_next(index) will return the size of the bitset.
Below is the illustration of the above function:
Next set bit after index 0 in bset 5 Next set bit after index 6 in bset 10 Find all set bits in bset1 0 12 17 30 Next set bit after index 5 in bset2 32
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- _Find_first() function in C++ bitset with Examples
- bitset set() function in C++ STL
- bitset all() function in C++ STL
- std::bitset::to_ullong and std::bitset::to_ulong in C++ STL
- bitset reset() function in C++ STL
- bitset any() in C++ STL
- bitset none() in C++ STL
- bitset size() in C++ STL
- bitset::flip() in C++ STL
- C++ bitset and its application
- bitset test() in C++ STL
- bitset operator in C++ STL
- bitset count() in C++ STL
- C++ bitset interesting facts
- Subset sum queries using bitset
- Count number of set bits in a range using bitset
- Count number of common elements between two arrays by using Bitset and Bitwise operation
- ios eof() function in C++ with Examples
- ios bad() function in C++ with Examples
- fill_n() function in C++ STL with examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.