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

Discussion in 'C++' started by DeadInPlastic, Jun 26, 2003.

  1. 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.
    DeadInPlastic, Jun 26, 2003
    #1
    1. Advertising

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

    DeadInPlastic wrote:
    >
    > 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.


    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
    Karl Heinz Buchegger, Jun 26, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mark
    Replies:
    1
    Views:
    726
    Victor Bazarov
    Jun 19, 2004
  2. =?ISO-8859-1?Q?Gregory_Pi=F1ero?=

    How do I put % in a format sting?

    =?ISO-8859-1?Q?Gregory_Pi=F1ero?=, Oct 5, 2006, in forum: Python
    Replies:
    5
    Views:
    268
    John Salerno
    Oct 6, 2006
  3. Ivan Reborin
    Replies:
    27
    Views:
    1,683
  4. David Gerber

    need to remove a portion of a sting

    David Gerber, Dec 23, 2011, in forum: Ruby
    Replies:
    1
    Views:
    484
    gerberdata
    Dec 23, 2011
  5. seven.reeds
    Replies:
    1
    Views:
    202
    seven.reeds
    Aug 9, 2009
Loading...

Share This Page