fork download
  1. #include <iostream>
  2. #include <stdio.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. char c = 0x80;
  7. printf("%x\n", c); //c は char型
  8. int n = (c & 0xF0) >> 4;
  9. std::cout << n << std::endl;
  10. return 0;
  11. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
ffffff80
8