Home > Back-end > C, how to use a single Chinese character on char types to initialize?
C, how to use a single Chinese character on char types to initialize?
Time:02-15
Int main (void) { cout <"Define a character array [], can use the array name a to output:"; Char a []="I love you". cout cout <"But can't use subscript to output a [2], otherwise, cout output gap:"; cout cout <"Char variable cannot be initialized with a single Chinese character, otherwise, cout output gap:"; Char b='me'; cout cout cout <"Why is this? \ n ";
return 0; }
CodePudding user response:
CodePudding user response:
Because both multi-byte character and wide characters, Chinese characters need to be more than 1 byte space can put down, the char type variable only 1 byte of space, not put, Cout of responsible attitude, don't want to give you the code, so just blank, blank than the code look better,