What is the use of wchar_t in general programming?

前端 未结 7 1762
忘掉有多难
忘掉有多难 2020-12-24 01:09

Today I was learning some C++ basics and came to know about wchar_t. I was not able to figure out, why do we actually need this datatype, and how do I use it?

相关标签:
7条回答
  • 2020-12-24 02:06

    wchar_t is used when you need to store characters with codes greater than 255 (it has a greater value than char can store).

    char can take 256 different values which corresponds to entries in the ISO Latin tables. On the other hand, wide char can take more than 65536 values which corresponds to Unicode values. It is a recent international standard which allows the encoding of characters for virtually all languages and commonly used symbols.

    0 讨论(0)
提交回复
热议问题