mardi 17 mars 2020

Why const char * type in C++ can store unicode?

I can write code like this:

const char * a = "你好";
cout<<a;

But when write like this:

char a[] = {'你','好'};
cout<<a;

It output garbled codes like this:

enter image description here

I thought the Chinese Character are stored in wchar_t,

so how const char * contain Chinese Character?

Aucun commentaire:

Enregistrer un commentaire