fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5.  
  6. short i = 4535;
  7.  
  8. signed char a[2];
  9.  
  10. a[0]=(i>>8) & 0xff;
  11. a[1]=i & 0xff;
  12.  
  13. short j = (a[0] << 8) | a[1];
  14.  
  15. printf("size = %d,i = %d\n",sizeof(i),i);
  16.  
  17. printf("j = %d\n",j);
  18.  
  19.  
  20. printf("a0 = %d,a1=%d \n",a[0],a[1]);
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
size = 2,i = 4535
j = -73
a0 = 17,a1=-73