Time:09-30
CodePudding user response:
to under the unicode, consult everybody, fairy,
void HexDump) (char * buf, int len, int addr) {Int I, j, k; Char binstr [80]. for (i=0; IIf (0==16) (I %) {Sprintf (binstr, "% x - 08", I + addr); Sprintf (binstr, "% s % 02 x", binstr, buf (unsigned char) [I]); } else if (15==16) (I %) {Sprintf (binstr, "% s % 02 x", binstr, buf (unsigned char) [I]); Sprintf (binstr, "% s", binstr); For (j=I - 15; J<=I; J++) {Sprintf (binstr, "% s % c," binstr, ('! '& lt; Buf [j] & amp; & Buf [j] <='~')? Buf [j] : '. '); } Printf (" % s \ n ", binstr); } else {Sprintf (binstr, "% s % 02 x", binstr, buf (unsigned char) [I]); } } If (0! 16)=(I %) {16 k=16 - (I %); for (j=0; JSprintf (binstr, "% s", binstr); } Sprintf (binstr, "% s", binstr); K=16 - k; For (j=I - k; JSprintf (binstr, "% s % c," binstr, ('! '& lt; Buf [j] & amp; & Buf [j] <='~')? Buf [j] : '. '); } Printf (" % s \ n ", binstr); } }
computer memory or file content or transport it is just a one-dimensional binary byte array and its corresponding binary address; The human brain to a computer memory or file contents or transfer the content of the one-dimensional binary byte array and its corresponding binary address some parts as an integer, number of signed/unsigned number, floating point Numbers, complex Numbers, letters, digits, Chinese/Korean/French... Character/string, assembly instructions, functions, function parameters, heap, stack, arrays, Pointers, array pointer and pointer array, the array of arrays, pointer to pointer, two-dimensional arrays, character lattice, the coordinates of character strokes, black and white binary images and grayscale images, color images, audio, video, fingerprint information, id information... For computer no noise, only the binary bytes; To the human brain is gibberish, GBK: 0 xb0 0 xa1, Unicode - 16 LE: 0 x4a 0 x55, Unicode - 16 BE: 0 x55 0 x4a, utf-8 8-0 x95 xE5 0 0 x8a void HexDump) (char * buf, int len, int addr) {Int I, j, k; Char binstr [80]. for (i=0; IIf (0==16) (I %) {Sprintf (binstr, "% x - 08", I + addr); Sprintf (binstr, "% s % 02 x", binstr, buf (unsigned char) [I]); } else if (15==16) (I %) {Sprintf (binstr, "% s % 02 x", binstr, buf (unsigned char) [I]); Sprintf (binstr, "% s", binstr); For (j=I - 15; J<=I; J++) {Sprintf (binstr, "% s % c," binstr, ('! '& lt; Buf [j] & amp; & Buf [j] <='~')? Buf [j] : '. '); } Printf (" % s \ n ", binstr); } else {Sprintf (binstr, "% s % 02 x", binstr, buf (unsigned char) [I]); } } If (0! 16)=(I %) {16 k=16 - (I %); for (j=0; JSprintf (binstr, "% s", binstr); } Sprintf (binstr, "% s", binstr); K=16 - k; For (j=I - k; JSprintf (binstr, "% s % c," binstr, ('! '& lt; Buf [j] & amp; & Buf [j] <='~')? Buf [j] : '. '); } Printf (" % s \ n ", binstr); } }
Page link:https//www.codepudding.com/Softwareengineering/42779.html