Last active
January 7, 2019 13:56
-
-
Save simonliu009/c6fb219dcf081117c6448bd483f753fc to your computer and use it in GitHub Desktop.
c: set bitx to 1 or 0 #c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//设置某位为1 | |
number |= 1 << x; // 设置第x位为1 | |
//清除某位 | |
number &= ~(1 << x); // 置第x位为0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment