Write a subroutine named "index(s,c)" which expects two
arguments: the first is a pointer to characters 's' which
points to a null-terminated string, and the second
is a character 'c' which is to be searched for in the
string 's'. If the character 'c' does not
appear in the string return 0; otherwise return a pointer
to the position of 'c' in the string. Name the program "index.c";
as usual, compile and test it and then type "ready".
char *alpha "abcdefghijklmnopqrstuvwxyz";
printf("%d\n", index(alpha, '+'));
printf("%d\n",index(alpha, 't')-alpha));
printf("%d\n",index(alpha, 'a')-alpha));
printf("%d\n",index(alpha, 'z')-alpha));
printf("%d\n",index("", 'z'));