Advertisement
lukasd

zadanie 1 zestaw 15

Dec 19th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. void kolos1()
  2. {
  3.     int color = 0x123456;
  4.     unsigned char b = color & 0xFF;
  5.     unsigned char g = (color & 0xFF00) >> 8;
  6.     unsigned char r = (color & 0xFF0000) >> 16;
  7.     printf("%u %u %u", r, g, b);
  8.     color = 0;
  9.     color |= b;
  10.     color |= g << 8;
  11.     color |= r << 16;
  12.     printf("\n%x", color);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement