level 1
rihakuken
楼主
我在vscode中运行了一段代码
#include<stdio.h>
#include<stdlib.h>
int main(){
printf("hello!你好\n");
system("pause");
return 0;
}
当右下角的编码是UTF-8的时候,右键run code运行无误,但按f5窗口运行,中文就会变乱码
而当我把右下角编码改成gbk时,按f5窗口运行无误了,而按右键run code则报错了,报错是
warning: zero-length ms_printf format string [-Wformat-zero-length]
请问怎么设置才能让 f5 和 右键run code的两种当时都能顺利运行啊,谢谢
2021年06月22日 05点06分
1
#include<stdio.h>
#include<stdlib.h>
int main(){
printf("hello!你好\n");
system("pause");
return 0;
}
当右下角的编码是UTF-8的时候,右键run code运行无误,但按f5窗口运行,中文就会变乱码
而当我把右下角编码改成gbk时,按f5窗口运行无误了,而按右键run code则报错了,报错是
warning: zero-length ms_printf format string [-Wformat-zero-length]
请问怎么设置才能让 f5 和 右键run code的两种当时都能顺利运行啊,谢谢