c++清空屏幕的函数是什么

vc++写的控制台应用程序,怎么把屏幕清空,应该调用什么函数?

给你一个变态的方法
#include <stdio.h>
system("cls");
变态吧?
#include <iostream>
#include <cstdlib>

using namespace std;

int main()
// 清屏
{
for (int i=0; i<1000; ++i)
cout << i;

system("cls");
return 0;
}
函数名: clrscr <conio.h>
功 能: 清除文本模式窗口
用 法: void clrscr(void)

函数名: cleardevice
功 能: 清除图形屏幕
用 法: void far cleardevice(void)
举个例子吧。
#include<stdio.h>
#include <conio.h>
int main(void)
{
int i;
clrscr();
for (i = 0; i < 20; i++)
printf("%d\r\n", i);
printf("\r\nPress any key to clear screen");
getch();
clrscr();
printf("The screen has been cleared!");
getch();
return 0;
}
至于#include<conio.h>是放在#include<stdio.h>前还是后,无所谓的,习惯是之后。
温馨提示:内容为网友见解,仅供参考
第1个回答  2009-01-10
头文件
#include <windows.h>
函数是
system("CLS");
第2个回答  2009-01-10
system("cls");
要有#include<iostream>
第3个回答  2009-01-10
system("CLS");
相似回答