Last active
November 20, 2019 20:14
-
-
Save aneury1/a581d04e9fee5122c0a7ac7fa871335f to your computer and use it in GitHub Desktop.
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
#include <iostream> | |
... | |
void fn(){ | |
char ch = 0xDF; | |
for (int i =8; i > 0; i--) | |
{ | |
std::cout <<((ch&(1<<i))?1:0); | |
} | |
char v = 2; | |
for (int i = 0; i < 8; i++) | |
std::cout << ((v >> i)&0x1)<<"\n";///test | |
char v64='\0'; | |
v64 |= (1 << 3);///set | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment