IDE for vscode, use the scanf input Chinese characters, use the print output is empty or 00, why?
# include & lt; stdio.h>
Int main () {
Char name [20].
The scanf (" % s ", name);
Printf (" % s \ n ", name);
return 0;
}

CodePudding user response:
#include
#include
Int main () {
Char name [20].
CHCP system (" 65001 ");//CHCP 936
The scanf (" % s ", name);
Printf (" % s \ n ", name);
return 0;
} CodePudding user response: