#include <string.h>
#include <locale.h>
#include <stdlib.h>
 
/*
 * The following example uses the wcsrchr subroutine to locate the
 * last occurrence of a wide character in a wide character string
 */
int main(int argc, char **argv) {
    wchar_t *pwcs1, wc, *pws;
    int     retval;
 
    setlocale(LC_ALL, "");
    
    /*
     * Let pwcs1 point to a wide character null terminated string.
     * Let wc point to the wide character to search for.
     */
    pws = wcsrchr(pwcs1, wc);
    
    if (pws == (wchar_t )NULL) {
        /* wc does not occur in pwcs1  */
    } else {
        /* pws points to the location where wc is found */
    }
}