How I can convert negative number into ASCII value?
I have to convert -1 ** into **ASCII value.
That means:
inputbyte[] = 0
output[] = -1
I did replacement like:
replacement 0 to -1 in string.
But I cant treat -1 as a number after represent string into Byte[]. I have to handle -1 as a single number like in integer.
Actually My original problem is:
input = "0110110111001000";
output should be = "-111-111-1111-1-11-1-1-1";
after that, I should be able to treat -1 and 1 as numbers i.e Byte.
How can I do that?
thanks in advanced.
-1(signed char) equals to 127(unsigned char or ASCII value)
127 is DEL code in ASCII table.
To get an int from string:
Strring replacement:
Big-integer to string: