Originally Posted by
homoon
Oh, I have passed the char arrary to the RSA function, and the return is that:
out[0]= 41
out[1]= 79
....
that's mean each of the char array store the oct number; therefore, when I printf("%02x", out[0]), the value is 29.
can anyone tell me how to change it in hex and store in char array.
That is not an octal number, 41 in decimal is 29 in hex. You don't need to worry about it, octal, decimal or hex is all stored with the same representation, it's a matter of presentation only. Try this for example:
Code:
int a = 41;
printf("%d\n", a);
printf("%x\n", a);
printf("%o\n", a);