C++ bitset flip() FunctionC++ bitset flip() function is used to flip all the bit values converting zeros to ones and ones to zeros. If a parameter 'position' is passed, it flips the bit at the specified position only. SyntaxConsider bitset 'bs' as an object. Parameterpos:It takes one parameter 'pos' but it is not mandatory. Return valueIt returns a new binary representation number. Example 1Output: 1010 Example 2Output: 1101 001010
Next TopicC++ bitset
|