解决C/C++:[Error] 'getch' was not declared in this scope

编译器编译时出现报错[Error] ‘getch’ was not declared in this scope解决方法
报错的编译器有:VC++6.0/DevC++/IntelliJ IDEA 等
报错信息


出现[Error] ‘getch’ was not declared in this scope的报错是因为缺少头文件
在你的头文件中加入以下代码即可

#include<conio.h>

解决效果

发布了7 篇原创文章 · 获赞 7 · 访问量 1203

猜你喜欢

转载自blog.csdn.net/qq_44079145/article/details/104664341
今日推荐