Re: extracting string

Discussion in 'C Programming' started by Zoran Cutura, Jun 26, 2003.

  1. Zoran Cutura

    Zoran Cutura Guest

    qazmlp <> wrote:
    > const char* big = "abcdefgh123" ;
    > const char* small = "bcd" ;
    >
    > Now, I want to extract the remaining string from big, after the small
    > contents.
    > That is the result string should have "efgh123".
    >
    > I am confused about how to do it ?
    >
    > Please help! Thanks!


    strstr() is your friend. It will find your needle in the haystack, the
    returned pointer will point to the beginning of the needle, adding
    strlen(small) to that pointer will yield a pointer to the position after
    that substring.

    --
    Z ()
    "LISP is worth learning for the profound enlightenment experience
    you will have when you finally get it; that experience will make you
    a better programmer for the rest of your days." -- Eric S. Raymond
    Zoran Cutura, Jun 26, 2003
    #1
    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. R
    Replies:
    2
    Views:
    517
    Jon A. Cruz
    Jul 25, 2003
  2. Mar Thomas

    Extracting a string

    Mar Thomas, Sep 26, 2003, in forum: Java
    Replies:
    9
    Views:
    370
    Tony Morris
    Jan 15, 2004
  3. Ben Pfaff

    Re: extracting string

    Ben Pfaff, Jun 26, 2003, in forum: C Programming
    Replies:
    0
    Views:
    685
    Ben Pfaff
    Jun 26, 2003
  4. Martien Verbruggen

    Re: extracting string

    Martien Verbruggen, Jun 26, 2003, in forum: C Programming
    Replies:
    0
    Views:
    715
    Martien Verbruggen
    Jun 26, 2003
  5. CBFalconer

    Re: extracting string

    CBFalconer, Jun 26, 2003, in forum: C Programming
    Replies:
    0
    Views:
    703
    CBFalconer
    Jun 26, 2003
Loading...

Share This Page