views:

95

answers:

2

Using xcode, I'm trying to get a const c string into a unichar array by doing the following:

const unichar *str = "Test String";

but the "Test String" is typed to be (const char *) and produces compiler errors. Is there way to specify a "Test String" that is of type unichar?

I was hoping for somethig like:

const unichar *str = U"Test String";

so all the work was done during compile.

A: 

Perhaps const unichar *str = L"Test String"; would work for you.

+1  A: 

as far as i know there is no way to do it using a string like that.
You can do it like this
const unichar string[] = {'u','n','i','c','o','d','e'};

But aside from that, i don't know.
But i could be wrong i haven't done very much with this side of c++ :)

Craig