Suppose i get an array of chars

"(1110,999)(10,10)"

how extract the numbers which are in the coordinates

1110

999

10

the -'0' thing works only for a single digit numbers

??

Printable View

- 01-03-2009transgalactic2how to transform an aray of char in to a big number
Suppose i get an array of chars

"(1110,999)(10,10)"

how extract the numbers which are in the coordinates

1110

999

10

the -'0' thing works only for a single digit numbers

?? - 01-03-2009root4
you have to extract 'manually' the substrings corresponding to each number then you apply strtol() (this is one solution) to each one of them, e.g. strtol("1110",0,10) returns you (long)1110. For the 'how extract the number', I let you think a bit (you can check strtok() for instance).

PS: you can use the -'0' thing as you say, if you write your own str to int function (as you work on single digits)