i hava 2 dimensional array that hold unsigned char like 234,678,87,23,23, and some thing like that.
i want to convert this to integer how is it posssible.
regards
mak.
Printable View
i hava 2 dimensional array that hold unsigned char like 234,678,87,23,23, and some thing like that.
i want to convert this to integer how is it posssible.
regards
mak.
If it's a string then you can use atoi() function to do this.
Using strtol() would be better:
- it detects overflow
- it returns a pointer to the end of the converted string. Ideal if you're walking through a list of numbers.
Impossible
(edit, unless your value takes up two or more character positions, in which case, none of the string functions will work by themselves - you'll have to move the 2 or more bytes into another array, null terminate them, and then you can use a string function on it.
Nah, it's possible with 10 bit bytes. But yeah, more likely it was just a typographical error when generating a random list of numbers by hand.Quote:
Originally Posted by Dino