I work a lot with network and serial communications software, so it is often necessary for me to have code to display or log hex dumps of data packets.
Every time I
I often use this little snippet I've written long time ago. It's short and easy to add anywhere when debugging etc...
#include #include void hexdump(void *ptr, int buflen) { unsigned char *buf = (unsigned char*)ptr; int i, j; for (i=0; i