修用vs2019使用_getch()时下面出现绿色波浪线,显示返回值被忽略
#include <graphics.h>
#include <conio.h>
int main()
{
initgraph(880, 660);
_getch();
closegraph();
return 0;
}
修用vs2019使用_getch()时下面出现绿色波浪线,显示返回值被忽略
#include <graphics.h>
#include <conio.h>
int main()
{
initgraph(880, 660);
_getch();
closegraph();
return 0;
}
因为 _getch() 会返回一个数值,但是你没有用一个变量来保存这个数值,所以 VS 抛出一个警告提示你。
我一直觉得这个警告有点莫名其妙,暂时只能忽略,程序不受影响。