I want to convert an integer into char array and retreive the same number from that char array.
Consider the number 20. As 1 int(4 bytes) = 1 char,
0000 0000 0000 0000 0000 0000 0001 0100 = (20) in decimal
___0 ___0 ___0 ___0 ___0 ___0 ___1 ___4 = hexadecimal representation
I want this pattern 00000014 to be stored in char array as 4 chars only as integer occupies 4 chars of space in such a way that the char array after converting into integer(can use sscanf()) will give the same result(20).
How do I do that?