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.
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.
Not everything that can be counted counts, and not everything that counts can be counted
- Albert Einstein.
No programming language is perfect. There is not even a single best language; there are only languages well suited or perhaps poorly suited for particular purposes.
- Herbert Mayer
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.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
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.
Last edited by Dino; 12-13-2008 at 09:18 AM.
Mainframe assembler programmer by trade. C coder when I can.
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.Originally Posted by Dino
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)