If I have the s [11]=={0 x 5, 0 xc5, 0 xb2, 0 xea... } the number 11, how to splice them as 05 c5b3... In this form
CodePudding user response:
The use of itoa
#include
#include
using namespace std;
Int main () {
Int s [11] {0 x 5, 0 xc5, xb2 0, 0 xea};
Char STR [100]="";
Char TMP [10].
For (int I=0; I & lt; 4. I++)
Sprintf (& amp; STR [strlen (STR)], "s" % 02, itoa (s [I], TMP, 16));
Printf (" % s ", STR);
return 0;
}
CodePudding user response: