C++ bitset test() FunctionC++ bitset test() function is used to test whether the bit at position p is set or not. If bit is set at position p then it returns true or false. SyntaxParameterp: It takes one parameter and it specifies the index at which the bit is set or not. Return valueIt returns true if the bit at position p is set, and false if it is not set. Example 1Output: bitset b is set at position 3 : 0 bitset b is set at position 2 : 1 Example 2Output: bitset b is set at position 3 : 0 bitset b1 is set at position 2 : 1 Example 3Output: bitset is set at postion 1
Next TopicC++ bitset
|