C strrchr()

The strrchr() function returns a pointer to the last occurrence of the low-order byte of ch in the string pointed to by str. If no match is found, a null pointer is returned.

strrchr() Syntax

Following is the syntax of the strrchr() function :

char *strrchr(const char *str, int ch);

strrchr() Example

Following program prints the string is a test :

void main()
	char *p;
	p = strrchr("this is a test", 'i');

C Online Test

« Previous Chapter Next Function »

Like/Share Us on Facebook 😋