Ah, you're translating from Chinese? No wonder you're having trouble with the technical translation...
By "linear collection" I meant an
array. An array is usually written with each
element in the array written separately:
const char name[ 6 ] = { 'M', 'u', 'l', 'a', 'n', '\0' };
However, with character
strings ('string' is another word for 'array', except that in C we typically mean an array of
char), we can use a shortcut and just write it in double quotes ("):
const char name[ 6 ] = "Mulan";
Remember what I wrote:
A char is an 8-bit entity -- good for ASCII and various multilingual code pages.
A wchar_t is a 16- or 32-bit entity (depending on your platform and compiler) -- good for things like Unicode. |
In either case, the value represents a
single character.
If you want
more than one character, you must have an array of characters. Since you are using Chinese, you want to use
wchar_t, since it can be used to display Chinese mesographs (because
char cannot).
In C:
const wchar_t name[ 4 ] = L"花木蘭";
In C++:
wstring name( L"花木蘭" );
Hope this helps.