fork download
  1. #include <stdio.h>
  2.  
  3. void send_array(int one, int two, const char *f, const char *t) {
  4. (void)one; (void)two; (void)f; // ignore unused variables
  5. printf("send_array() called with %s\n", t);
  6. }
  7.  
  8. int main(void) {
  9. int array[] = {0xd3, 0x8a, 0xf0, 0x21, 0x1e, 0x1f, 0xe7, 0xc3, 0xa1, 0xa4, 0x47};
  10. char buffer[1000]; // large enough
  11. char *b = buffer + sprintf(buffer, "%02x", array[0]);
  12. for (unsigned i = 1; i < sizeof array / sizeof *array; i++) {
  13. b += sprintf(b, " %02x", array[i]);
  14. }
  15. send_array(1, 2, "%s\n", buffer);
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 4728KB
stdin
Standard input is empty
stdout
send_array() called with d3 8a f0 21 1e 1f e7 c3 a1 a4 47