#include <stdio.h>
#include <string.h>

int main()
{
  char *p;

  p = strrchr("ABCDEFG", 'A');
  printf("%s\n", p);

  p = strrchr("ABCDEFG", 'C');
  printf("%s\n", p);

  p = strrchr("ABCDABCD", 'A');
  printf("%s\n", p);

  p = strrchr("ABCDABCD", 'D');
  printf("%s\n", p);

  p = strrchr("ABCDEFG", 'a');
  if (p)
    printf("ERROR");

  return 0;
}
