Why was wchar_t invented?

前端 未结 10 1732
说谎
说谎 2021-01-03 20:15

Why is wchar_t needed? How is it superior to short (or __int16 or whatever)?

(If it matters: I live in Windows world. I don\'t

10条回答
  •  清歌不尽
    2021-01-03 20:58

    See Wikipedia.

    Basically, it's a portable type for "text" in the current locale (with umlauts). It predates Unicode and doesn't solve many problems, so today, it mostly exists for backward compatibility. Don't use it unless you have to.

提交回复
热议问题