// Use wcscspn() — to find the offset of the first wide-character that are part
// of wide-character string
#include <stdio.h>
#include <wchar.h>
int main(void)
{
wchar_t s[] = L"cc++java";
wchar_t sub[] = L"java";
int pos;
pos = wcscspn (s, sub);
wprintf(L"%d\n", pos);
return 0;
}
/*
run:
4
*/