#include <ctype.h>
#include <stdio.h>

void dumpdata(unsigned char *data, size_t bytes) {
  size_t lin;
  for (lin = 0; lin < bytes; lin += 16) {
    size_t col;
    printf("%08lX: ", (unsigned long)lin);
    for (col = 0; (col < 16) && (lin + col < bytes); col += 1) {
      printf("%02x ", data[lin + col]);
    }
    for (; col < 16; col += 1) {
      printf("   ");
    }
    printf("| ");
    for (col = 0; (col < 16) && (lin + col < bytes); col += 1) {
      if (isprint(data[lin + col])) {
        putchar(data[lin + col]);
      } else {
        putchar('.');
      }
    }
    putchar('\n');
  }
}

int main(void) {
  char words[10][9] = {
    "Hello\n",
    "Good-bye"
  };

  dumpdata((void*)words, sizeof words);
  return 0;
}