Advertisement
SEEEEEAAAAAA10000000

Construct an int from bytes

Dec 7th, 2019
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1.     unsigned char w = 0x22;
  2.     unsigned char x = 0x99;
  3.     unsigned char y = 0x7C;
  4.     unsigned char z = 0xD2;
  5.    
  6.     int u = w;
  7.     u = u << 8;
  8.     u = u + x;
  9.     u = u << 8;
  10.     u = u + y;
  11.     u = u << 8;
  12.     u = u + z;
  13.    
  14.     printf("u: %x \n", u);
  15.  
  16. u: 22997cd2
  17. Program ended with exit code: 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement