Working with UNICODE is no different from working with ANSI characters. The differences are minimal:
- Instead of
char , wchar_t used (under Windows, WCHAR possible), - UNICODE strings
L"..." are used instead of the strings "..." - UNICODE versions of string functions are used, for example,
wcslen instead of strlen .
This is all you need to do to convert the program to work with unicode strings.
As for your program, you should not pay attention to what the compiler writes to you. Syntax errors are the easiest, just read the compiler messages. For example:
int lenght = size_t wcslen (string);
error, size_t not clear what. If you wanted to convert the wcslen result to lenght , you would have to write this:
int lenght = (int)wcslen (string);
Farther:
for (i = 0; j = lenght - 1; i < j; i++; j--)
The for loop must contain three expressions separated by semicolons. You have five. You probably wanted to write like this:
for (i = 0, j = lenght - 1; i < j; i++, j--)
For you, a comma may differ slightly from a semicolon, but for a compiler these are completely different things. He is not trying to guess what you meant, just notes it as a mistake.
The rest seems to be correct.