Generated after processing inspection hexadecimal string displayed in the text, format the following "0200030 b3a00000000013231343433b903", now to a set of two characters into an array, the array should be a (0)=& amp; The H2 a (1)=& amp; H0 a (2)=& amp; H3 a (3)=& amp; HB a (4)=& amp; H3A a (5)=& amp; H0 so on
CodePudding user response:
As a C programmer, the The scanf, sscanf, fscanf Printf, sprintf, fprintf Usage of this kind of function, or to do "boxing hand, curved mouth",
# include & lt; Stdio. H> Char [] s="0200030 b3a00000000013231343433b903"; Char b [100]; Int I, v; Int main () { i=0; While (1) { If (1!=sscanf (s + 2 * I, "% 2 x", & amp; V)) break; [I]=b (char) v. i++; If (i>=100) break; } N=I; for (i=0; Ireturn 0; }