hey can anyone tell me that in C program what is the use of strstr function is?????
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.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson
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);