So I want to compare the longer wchar_t type to a char type, using
wcsstr and wcsstr.

With a raw string, I can use 'L' like so:

wcsstr((uint16_t *)wchar_String, L"regularCharString")



BUT... say I have:

char * reg = "regularCharString"

How would I call wcsstr using the reg variable? (Tried typecasting,
but that doesn't work.)

Re: comparing a "wchar_t" to "char" by Igor

Igor
Thu Sep 21 13:37:02 CDT 2006

ern <erniedude@gmail.com> wrote:
> So I want to compare the longer wchar_t type to a char type, using
> wcsstr and wcsstr.
>
> With a raw string, I can use 'L' like so:
>
> wcsstr((uint16_t *)wchar_String, L"regularCharString")
>
>
>
> BUT... say I have:
>
> char * reg = "regularCharString"
>
> How would I call wcsstr using the reg variable? (Tried typecasting,
> but that doesn't work.)

You would need to convert your char string to Unicode string, e.g using
mbstowcs
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925