4.11 Wide Characters

I l @ ve RuBoard

4.11 Wide Characters

The problem with the char data type is that it was designed to hold only a basic character set. This is fine for all the American characters, but what about foreign languages? That where the wchar_t data type comes in. It is used to specify "wide characters" which include not only the basic American characters, but foreign characters as well. A wide character is declared just like a simple character:

 char simple;   // A simple character wchar_t wide;  // A wide character 

A simple character is declared by putting the character inside single quotes: 'X' . A wide character uses an "L" prefix to indicate that it is a wide character: L' figs/u03a9.gif ' .

For example:

simple = 'X';
wide = L' figs/u03a9.gif ';
I l @ ve RuBoard


Practical C++ Programming
Practical C Programming, 3rd Edition
ISBN: 1565923065
EAN: 2147483647
Year: 2003
Pages: 364

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net