XINU
strstr.c
Go to the documentation of this file.
1 
12 char *strstr(const char *cs, const char *ct)
13 {
14  char *cq;
15  char *cr;
16 
17  for (; *cs != '\0'; cs++)
18  {
19  if (*cs == *ct)
20  {
21  cq = (char *)cs;
22  cr = (char *)ct;
23  while ((*cq != '\0') && (*cr != '\0'))
24  {
25  if (*cq != *cr)
26  {
27  break;
28  }
29  cq++;
30  cr++;
31  }
32  if ('\0' == *cr)
33  {
34  return (char *)cs;
35  }
36  }
37  }
38  return 0;
39 }
char * strstr(const char *cs, const char *ct)
検索対象の文字列Aから文字列Bを探す。
Definition: strstr.c:12