1.
int my_strcmp(const char * str1, char * str2)           //my_strcmp库函数的实现
{
 int ret = 0;
 while ((*str1 == *str2) && *str1&&*str2)
 {
  str1++;
  str2++;
  while (!(*str1&&*str2))
   return 1;
 }
 return -1;
}
2.
char * strcat(char *str1, const char *str2)               //strcat库函数的实现方法
{
 char *cp = str1;
 while (*cp)
  cp++;
 while (*cp++ = *str2++)
  ;
 return str1;
}
3.
char *strncat(char *str1, const char *str2, int n)              //strncat库函数的实现方法
{  
 char *cp = str1;
 while (*cp)
  cp++;
 while(n--)
 {
  if (!(*cp++ = *str2++))
   return str1;
 }
 return str1;
}
4.
int my_strlen(const char *str1)                            //my_strlen库函数的实现方法
{
 int count = 0;
 while (*str1)
 {
  count++;
  str1++;
 }
 return count;
}
5.
char * my_strstr(const char *str1, const char *str2)                //my_strstr库函数的实现方法
{
 char *cp = str1;
 char *s1 = cp;
 char *s2=NULL;
 while (*s1)
 {
  s1 = cp;
  s2 = str2;
  while (*s1 && *s2 && !(*s1 - *s2))
  {
   s1++;
   s2++;
  }
  if (*s2 == '\0')
  {
   return cp;
  }
  cp++;
 }
 return NULL;
}