Like Tree3Likes
  • 3 Post By dmh2000

what is the use of strstr function

This is a discussion on what is the use of strstr function within the C Programming forums, part of the General Programming Boards category; hey can anyone tell me that in C program what is the use of strstr function is?????...

  1. #1
    Registered User
    Join Date
    Mar 2013
    Location
    Vadodara
    Posts
    2

    what is the use of strstr function

    hey can anyone tell me that in C program what is the use of strstr function is?????

  2. #2
    Registered User
    Join Date
    Mar 2011
    Posts
    546
    open browser, go to google.com. search for 'strstr'

  3. #3
    Registered User
    Join Date
    Mar 2013
    Location
    Vadodara
    Posts
    2
    Quote Originally Posted by Harshdesai View Post
    hey can anyone tell me that in C program what is the use of strstr function is?????
    Quote Originally Posted by dmh2000 View Post
    open browser, go to google.com. search for 'strstr'
    hey thanks for telling but i have found but i don't getting the exact meaning n its excat use of it?
    if u know than can u tell me???

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    2,521
    strstr - C++ Reference

    Can u read?

    Tim S.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  5. #5
    Stoned Witch Barney McGrew's Avatar
    Join Date
    Oct 2012
    Location
    astaylea
    Posts
    420
    Suppose you want to check whether there are any web links in a string, you could do:

    Code:
    const char *str = "abcdefghijklmnop http://foo.bar qrstvuwxyz", *sp;
    
    if ((sp = strstr(str, "http://"))) handle_link(sp);
    In this case a pointer to the substring, "http://foo.bar qrstvuwxyz" will be stored in sp. The best way to understand how strstr works would be to implement it yourself, although I'd suggest starting with strchr first.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help with strstr() function
    By zacavitch in forum C Programming
    Replies: 13
    Last Post: 10-12-2009, 02:14 AM
  2. strstr and utf-8
    By MK27 in forum C Programming
    Replies: 2
    Last Post: 02-01-2009, 09:54 PM
  3. need help with strstr function for microcontroller
    By Lince in forum C Programming
    Replies: 2
    Last Post: 08-07-2008, 08:47 AM
  4. Replies: 14
    Last Post: 03-02-2008, 12:27 PM
  5. about strstr()
    By heeroyung in forum C Programming
    Replies: 6
    Last Post: 10-07-2005, 12:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21