So what I'm trying to do is write Japanese characters to my terminal screen using C and wide characters.
The question is whats wrong with what I'm doing so that I can fix it, what other caveats should I expect while using wide characters and do you have any other comments about what I'm trying to do?
The bad code:
#include <stdio.h>
#include <wchar.h>
int main( ) {
wprintf(L"%c\n", L"\x3074");
}
This doesn't work, but I want to know why.
the problem only gets worse when I try to use a wchar_t to hold a value:
wchar_t pi_0 = 0x3074; // prints a "t" when used with wprintf
wchar_t pi_1 = "\x3074"; // gives compile time warning
wchar_t pi_2 = L"\x3074"; // gives compile time warning
So I'd also like to make this work too, as I plan on having data structures holding strings of these characters.
Thanks!