vscode--scanf输入中文问题
如题,printf正常输出中文字符,为什么scanf输入中文后不能正常输出中文?#include <stdio.h>
int main(){
int a;
char name;
a=scanf("%s",name);
printf("%d",a);
printf("\n%s",name);
return 0;
} vscode F5调试输入中文会输出错误,求解 我这vscode可以正常输出中文啊,你那输出的是什么?
PS F:\code> GCC -fexec-charset=GBK test.c -o test ; if ($?) { .\test }
你好
1
你好
PS F:\code> 你程序有问题,你那数组怎么控制啊。
页:
[1]