codescracker
c

C strpbrk()



« Previous Chapter Next Function »

strpbrk()

The strpbrk() function returns a pointer to the first character in the string pointed to by str1 that matches any character in the string pointed to by str2. The null terminators are not included. If there are no matches, a null is returned.

strpbrk() Syntax

Following is the syntax of the strpbrk() function :

#include<string.h>
char *strpbrk(const char *str1, const char *str2);

strpbrk() Example

Following program prints the message s is a test on the screen :

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

C Online Test


« Previous Chapter Next Function »



© Copyright 2021. All Rights Reserved.

CodesCracker