0

why for in following function used 't' for int ch"? ch is int, why use char?

Synopsis:

#include <stdio.h>
char *strrchr(char *string, int c);

Example:

#include <stdio.h>
int main() {
  char *s;
  char buf [] = "This is a testing";
  s = strrchr (buf, 't');
  if (s != NULL)
printf ("found a 't' at %s\n", s);
  return 0;
}
  • 1
    Possible duplicate of [Why does strchr take an int for the char to be found?](http://stackoverflow.com/questions/2394011/why-does-strchr-take-an-int-for-the-char-to-be-found) – Jehy May 21 '16 at 06:57
  • oh jehy, i got my answer, thank you very much jehy, – daniel jones May 21 '16 at 08:34

0 Answers0