bitset::operator is a built-in function in C++ STL which is used to assign value to any index of a bitset.
bitset_name[index] = value
Parameter: The parameter index specifies the position at which the value is to be assigned.
Return Value: The function returns the value to the bit at the index.
Below programs illustrate the bitset::operator function.
The bitset after assigning values is: 100100
The bitset after assigning values is: 001100
The bit value at index 3 is 1
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- std::bitset::to_ullong and std::bitset::to_ulong in C++ STL
- Why overriding both the global new operator and the class-specific operator is not ambiguous?
- Operator Overloading '<<' and '>>' operator in a linked list class
- bitset any() in C++ STL
- bitset none() in C++ STL
- bitset size() in C++ STL
- bitset test() in C++ STL
- C++ bitset and its application
- bitset count() in C++ STL
- bitset::flip() in C++ STL
- bitset set() function in C++ STL
- bitset all() function in C++ STL
- C++ bitset interesting facts
- bitset reset() function in C++ STL
- Subset sum queries using bitset
- _Find_first() function in C++ bitset with Examples
- _Find_next() function in C++ bitset with Examples
- Count number of set bits in a range using bitset
- Count number of common elements between two arrays by using Bitset and Bitwise operation
- dot (.) operator in C/C++
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.