I am looking for some help with printing a only the first 28 significant bits in a 32 bit unsigned char.Here is some code that i have done so far.
When I print this, I get what I need for the 1st 6 hex characters, or 12 bits, but the last byte will always print out a 2 digit hex character (8 bits) instead of only 1 hex character (4 bits). Anyone know how I can accomplish this? Thank you in advance.Code:void printHexOut(unsigned char *keyC, int Index[]) { int i; for (i = 0; i < 4; i++) { if (i == 3) { fprintf(stderr, "%1x", (unsigned char)(keyC[i])); } else { fprintf(stderr, "%02x", (unsigned char)keyC[i]); } } fprintf(stderr,"\n"); }