Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie help

Status
Not open for further replies.

isdex1

MIS
Jan 1, 2003
9
US
I just starting to program in C, is there a C build in function to compare 2 strings. I don't mean strcmp, what I am looking for is:

S1 = "Partner with us"
S2 = "art"
S3 = "ers"

return true when compare S2 to S1
return false when compare S3 to S1

Thanks.
 
see strstr(). Although it does not strictly return true and false it should meet your needs.

-pete
 
Code:
int partof(const char *s1, const char *s2)
{
  return strstr(s1, s2) != NULL;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top