![]() |
![]() |
![]() |
C++ Reference: strrchr()
strrchr()
Declaration
char* strrchr(const char* kcpString, int iChar);
Description
This function returns a pointer to the last occurrence of "iChar" in the string "kcpString." If no occurrence is found, the function returns NULL.
Example
#include <cstdio>
#include <cstring>
int main()
{
char caString[] = "XoaX.net";
// Find the first 'e' inside of "XoaX.net"
char* cpFound = strrchr(caString, 'e');
printf("First e found at %i\n", (cpFound - caString));
return 0;
}
Output:
![]() |
![]() |
![]() |
| Home | | | Reference | | | Play Games! | | | Blog | | | Forum | | | Site Map | | | Contact Us |





