C++ bitset set() FunctionC++ bitset set() function is used to set all the bits to 1. If only a single parameter is passed, it sets the bit at that particular index to 1. SyntaxParameterindex: This parameter specifies the position at which the bit has to be set. The parameter is an optional one. val: this parameter specifies a boolean value which has to bet set at the index. The parameter is an optional one. Return valueIt does not return any value. Example 1Output: before applying set method : 1001 after applying reset method : 1111 Example 2Output: Before applying set() function: 1100 After applying set(1) function: 1110 Before applying set() function: 100100 After applying set(2, 0) and set(4, 1) function: 110000 Next TopicC++ bitset |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India