Do I do it like:

wchar_t *str = L"12345";

because that doesn't seem to be working.

Comments
This post doesn't seems to be working, neither.

Do you have a decent definition of "doesn't seem to be working"?

Nothing is printed?
Something is printed?
Your disk has been reformatted?

Comments
thanks for the morning chuckle

Do you have a decent definition of "doesn't seem to be working"?

Nothing is printed?
Something is printed?
Your disk has been reformatted?

Sorry,

When using the L"str" as an argument to a function, it only gives the first character of the string (ie, 's')

Also, the following snippet prints nothing:

wprintf(L"%s\n", L"string");

Oops I found what the problem is. The function expects ucs2 and wchar_t is ucs4.

I'm about to mark this as solved, but does anybody have any idea how to get around this (give the function what it wants)?

Now when you say "gcc", are we assuming Linux, or one of the windows ports like MinGW or DJGPP (or others?)

This question has already been answered. Start a new discussion instead.