All pastes #197514 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-10-11 11:00 UTC
rendered paste body
int     my_strlen(char *src)
{
  int   i;

  i = 0;
  while (src[i] != '\0')
    {
      i++;
    }
  return (i);
}

char    *my_strstr(char *str, char *to_find)
{
  int   n;
  int   m;
  int   c;
  int   d;

  n = 0;
  m = 0;
  while (to_find[m] != '\0')
    {
      while (str[n] != '\0')
        {
          c = n;
          d = m;
          while (str[c] == to_find[d])
            {
              c++;
              d++;
              if (to_find[d] == '\0')
                return (&str[n]);
            }
          n++;
        }
      m++;
    }
  return (0);
}