fork download
  1. #include <stdio.h>
  2.  
  3. void dump_hex(char* ptr, size_t length)
  4. {
  5. size_t i;
  6. for(i = 0; i < length; ++i)
  7. {
  8. printf("%01x%01x", (ptr[i] >> 4) & 0x0F, ptr[i] & 0x0F);
  9. }
  10. }
  11.  
  12. int main(void) {
  13. char hoge[] = { 0xde, 0xad, 0xbe, 0xef };
  14. dump_hex(hoge, 4);
  15. return 0;
  16. }
Success #stdin #stdout 0s 5452KB
stdin
Standard input is empty
stdout
deadbeef