codescracker


c

C strrchr()



« Previous Chapter Next Function »


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 :

#include<string.h>
char *strrchr(const char *str, int ch);

strrchr() Example

Following program prints the string is a test :

#include<string.h>
#include<stdio.h>
#include<conio.h>
void main()
{
	clrscr();
	char *p;
	p = strrchr("this is a test", 'i');
	printf(p);
	getch();
}

« Previous Chapter Next Function »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test