fork download
  1. #include<stdio.h>
  2.  
  3. int main(){
  4. int i = 5;
  5. printf("i = %d \n", i);
  6.  
  7. char *c = (char*)&i;
  8. printf("First Byte is %d \n", *(c));
  9. printf("Second Byte is %d \n", *(c+1));
  10. printf("Third Byte is %d \n", *(c+2));
  11. printf("Forth Byte is %d \n", *(c+3));
  12. return 0;
  13. }
Success #stdin #stdout 0s 5280KB
stdin
123
stdout
i = 5 
First Byte is 5 
Second Byte is 0 
Third Byte is 0 
Forth Byte is 0