is there a nice way to read consequtive integers from a character sting

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DeadInPlastic

    is there a nice way to read consequtive integers from a character sting

    char * blah = "blha222222blah ";
    i am wondering if there a way to read these 222222 at once. i can read
    one char at a time of course but it doesn't work for me since I have
    only one digit(i.e . 2) that I can't even convert from char to int.
  • Karl Heinz Buchegger

    #2
    Re: is there a nice way to read consequtive integers from a charactersting



    DeadInPlastic wrote:[color=blue]
    >
    > char * blah = "blha222222blah ";
    > i am wondering if there a way to read these 222222 at once. i can read
    > one char at a time of course but it doesn't work for me since I have
    > only one digit(i.e . 2) that I can't even convert from char to int.[/color]

    So start working on the last part:
    given a sequence of characters, each beeing a digit, how do I convert
    them to the correspondig number?

    Hint: This new question is asked at least 15 times a week. So looking up
    previous posts might be a good idea.

    --
    Karl Heinz Buchegger
    kbuchegg@gascad .at

    Comment

    Working...