Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. byte a, b;
  2. a = 1;
  3. b = 2;
  4. var c = a - b; //In visual studio, hover over "var" and the tip will indicate the data type, or you can get the value from cName below.
  5. string cName = c.GetType().Namespace + '.' + c.GetType().Name;
  6.  
  7. byte a = 0x80; // Won't compile!
  8. byte b = (byte) 0x80;
  9. byte c = -128; // Equal to b
  10.  
  11. byte a = 70;
  12. byte b = 80;
  13. byte c = a + b; // c == -106
  14.  
  15. signed byte b = 0b10000000;
  16. b = b >> 1; // b == 0b1100 0000
  17. b = b & 0x7F;// b == 0b0100 0000
  18.  
  19. unsigned byte b = 0b10000000;
  20. b = b >> 1; // b == 0b0100 0000;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement