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
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- 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 none() in C++ STL
- bitset any() in C++ STL
- C++ bitset and its application
- bitset all() function in C++ STL
- bitset set() function in C++ STL
- bitset count() in C++ STL
- bitset size() in C++ STL
- bitset::flip() in C++ STL
- bitset test() in C++ STL
- bitset reset() function in C++ STL
- Subset sum queries using bitset
- C++ bitset interesting facts
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.