I would like to add an int
value in a char
array. meaning if I have a 1
, I would like to represent it like '1'
.
I have seen an equation to do this before to get the ASCII code of it. am working with a limited compiler for C so I don't have the luxury to use functions like sprintf()
or others. it has to be in the form of an equation that I must implement. Can anybody help me with that.
example of what I'd like to do
char array[2];
char array[0] = 1 * (equation);
and then array[0]
should have the value '1'.