RicardasSim

shift

Oct 8th, 2023
963
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. unsigned int TestF( unsigned char a,
  5.                     unsigned char b,
  6.                     unsigned char c,
  7.                     unsigned char d )
  8. {
  9.     return ( a << 24 ) | ( b << 16 ) | ( c << 8 ) | d;
  10. }
  11.  
  12. int main()
  13. {
  14.  
  15.     unsigned int ret_val = TestF( 1, 2, 3, 4 );
  16.  
  17.     printf("%08X\n", ret_val);
  18.  
  19.     return 0;
  20. }
  21.  
  22. /*
  23. output:
  24.  
  25. 01020304
  26. */
  27.  
Advertisement
Add Comment
Please, Sign In to add comment