void printstr(char *str);

char *_strchr(char *s, int c)
{
  while (1) {
    if (*s == c)
      break;
    if (*s == '\0') {
      s = 0;
      break;
    }
    s++;
  }
  return (char *)s;
}

int main()
{
  char *p;

  p = _strchr("ABCDEFG", 'A');
  printstr(p);

  p = _strchr("ABCDEFG", 'C');
  printstr(p);

  p = _strchr("ABCDABCD", 'A');
  printstr(p);

  p = _strchr("ABCDABCD", 'D');
  printstr(p);

  p = _strchr("ABCDEFG", 'a');
  if (p)
    printstr("ERROR");

  return 0;
}
