Hey
Why does Irrlicht use wchar_t instead of just char? I've looked in google to find advantages but I haven't had any luck.
Thanks
wchar_t
Because there are more characters than just those used in English.
The char type is 8 bits, which means a maximum of 255 characters. (0 is used to terminate strings, and in fact there are also some control characters, which I'll ignore in this discussion).
Wide chars use 16 bit encoding so they can handle 65535 different characters.
I myself am not a fan of 16-bit encoding by the way, because it still cannot represent all characters anyway.
Here's somebody who can explain it all a bit better:
http://www.joelonsoftware.com/articles/Unicode.html
More info on unicode:
http://www.unicode.org/
The char type is 8 bits, which means a maximum of 255 characters. (0 is used to terminate strings, and in fact there are also some control characters, which I'll ignore in this discussion).
Wide chars use 16 bit encoding so they can handle 65535 different characters.
I myself am not a fan of 16-bit encoding by the way, because it still cannot represent all characters anyway.
Here's somebody who can explain it all a bit better:
http://www.joelonsoftware.com/articles/Unicode.html
More info on unicode:
http://www.unicode.org/