This function finds the first character in the string s1 that matches any character specified in s2 (It excludes terminating null-characters).
Syntax : char *strpbrk(const char *s1, const char *s2) Parameters : s1 : string to be scanned. s2 : string containing the characters to match. Return Value : It returns a pointer to the character in s1 that matches one of the characters in s2, else returns NULL.
Character not found First matching character: e
This function can be used in game of lottery where the person having string with letter
coming first in victory wins, i.e. this can be used at any place where first person wins.
Better luck next time Congrats u have won
This article is contributed by Shantanu Singh. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Difference between Virtual function and Pure virtual function in C++
- cin get() in C++ with Examples
- Difference between Increment and Decrement Operators
- Map of Vectors in C++ STL with Examples
- Problem in comparing Floating point numbers and how to compare them correctly?
- exit(0) vs exit(1) in C/C++ with Examples
- Predefined Macros in C with Examples
- How to create GUI in C programming using GTK Toolkit
- C++ program to print all Even and Odd numbers from 1 to N
- Reverse the content of a file and store it in another
- ctype.h(<cctype>) library in C/C++ with Examples
- Minimum cells to be flipped to get a 2*2 submatrix with equal elements
- Nested Loops in C++ with Examples
- Slack Bytes in Structures : Explained with Example
Improved By : SACHIN KUNTE