I would like to convert an int
to a char[4]
where each byte in the char[4]
contains a decimal value of 2. So in the following example:
int p = 2999999;
Convert p
to the array that is identical to k
where k
is constructed via:
char k[4];
k[0] = 2;
k[1] = 99;
k[2] = 99;
k[3] = 99;
How can I do this in C?
Thanks in advance!