0

Can someone explain to me why all these different chars were created? I'm new to programming and I have trouble understanding all the jargons in different posts to explain this.

So far I understand that char was to small to fit all the other characters that are not included in the ASCII code. So people created the other 3 char types. Is that true? And what does it mean that wchar_t is dependant on the locale?

sangmin park
  • 547
  • 3
  • 7
  • 16
  • 1
    https://en.wikipedia.org/wiki/Wide_character – Swift - Friday Pie Sep 10 '18 at 17:48
  • 2
    Have you read __Character types__: https://en.cppreference.com/w/cpp/language/types ? – Richard Critten Sep 10 '18 at 17:48
  • 1
    The one thing you're going to learn very quickly is that characters should be simple but in practice are far more complicated than you'd expect. Just as "a" is a character, so is "à" and "å" and "". – tadman Sep 10 '18 at 17:51
  • 1
    There's also `char`, `unsigned char` and `signed char` - which are *3 distinct types*. And then there's UTF-8 (and 7), UTF-16, UTF-32, `std::string`, `gstring`, `QString` and many more. It's a complicated mess. – Jesper Juhl Sep 10 '18 at 17:52
  • 1
    you might learn more than you want to know about character representation reading http://utf8everywhere.org/ – Swordfish Sep 10 '18 at 17:52

0 Answers0