hey can anyone tell me that in C program what is the use of strstr function is?????
Printable View
hey can anyone tell me that in C program what is the use of strstr function is?????
open browser, go to google.com. search for 'strstr'
strstr - C++ Reference
Can u read?
Tim S.
Suppose you want to check whether there are any web links in a string, you could do:
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.Code:const char *str = "abcdefghijklmnop http://foo.bar qrstvuwxyz", *sp;
if ((sp = strstr(str, "http://"))) handle_link(sp);