Книга: UNIX — универсальная среда программирования

3.8.50 strindex.c

3.8.50 strindex.c
strindex(s, t) /* return index of t in s, -1 if none */
 char *s, *t;
{
 int i, n;
 n = strlen(t);
 for (i = 0; s[i] != ''; i++)
  if (strncmp(s+i, t, n) == 0)
   return i;
 return -1;
}


Генерация: 1.260. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз