C examples for wchar.h:wcsrchr
function
<cwchar> <wchar.h>
Locate last occurrence of character in wide string
const wchar_t* wcsrchr (const wchar_t* ws, wchar_t wc); wchar_t* wcsrchr ( wchar_t* ws, wchar_t wc);
Parameter | Description |
---|---|
ws | C wide string. |
wc | Wide character to be located. |
A pointer to the last occurrence of wc in ws.
If wc is not found, the function returns a null pointer.
#include <wchar.h> int main ()/*from w ww . ja v a2 s . c o m*/ { wchar_t wcs[] = L"This is a sample wide string"; wchar_t * pwc; pwc = wcsrchr (wcs,L's'); wprintf (L"Last occurrence of L's' found at %d \n",pwc-wcs+1); return 0; }