In C programming the <string.h> strrchr function locate the last occurrence of a character in a string.The declaration of the string is given below.
|char *strrchr(const char *s, int c);|
s -The string from which the character is to be located.
c -An ‘int’ value converted to ‘char’,whose last occurrence is to be located in ‘s’.
char* -Returns a pointer to the character,or a null pointer if ‘c’ does not occur in the string.
Note the null-terminating character is part of the string,in other words if the character passed is a null,the character to be searched for in the ‘s’ string is a NULL.
int c=’E’ , null=’\0′ ;
ret=strpbrk(s1 , null);
The second returned value is NULL.