clrscr() 在 VC++(VS 2008) 中不起作用.....? [英] clrscr()not working in VC++(VS 2008).....?
问题描述
在 VS 2008 中,我在 VC++ 中创建了一个空项目,并添加了一个源文件为 ...
In VS 2008, I created an empty project in VC++ and added a source file as . . .
`
#include<stdio.h>
#include<conio.h>
int main()
{
....
clrscr();
.....
return 0;
}
`
我收到这些错误/警告:
警告 1 警告 C4013:'clrscr' 未定义;假设 extern 返回 int c:\tc\toh.c 170 TOH
Warning 1 warning C4013: 'clrscr' undefined; assuming extern returning int c:\tc\toh.c 170 TOH
错误 3 错误 LNK2019:未解析的外部符号 _clrscr 在函数 _main TOH.obj TOH 中引用
Error 3 error LNK2019: unresolved external symbol _clrscr referenced in function _main TOH.obj TOH
什么问题??
提前致谢..
推荐答案
使用 FillConsoleOutputCharacter 和 FillConsoleOutputAttribute 函数.在 MSDN 甚至有一个如何做到这一点的例子,方便地称为清屏"
Use the FillConsoleOutputCharacter and FillConsoleOutputAttribute functions. There is even an example of how to do that at MSDN, convenniently called "Clearing the screen"
这篇关于clrscr() 在 VC++(VS 2008) 中不起作用.....?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!