在Windows上用C清除命令提示符 [英] Clear command prompt with C on windows

查看:471
本文介绍了在Windows上用C清除命令提示符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能使用C在Windows上清除输出在命令提示符处?

Is it possible to clear the output at the command prompt using C on windows?

例如,在Linux上我可以做

For example, on linux I could do

printf("\033[2J");

但据我所知,Windows无法识别ANSI转义codeS
谢谢你。

But as far as I know windows doesn't recognise the ANSI escape codes Thanks.

编辑:我想我还需要后得到光标回0,0 FO R上的下一个输出清晰...

I guess I'll also need to get the cursor back to 0,0 fo r the next output after the clear...

推荐答案

有许多办法做到这一点在Windows上。

There are many way to do that on windows.

您包括 CONIO.H 并调用 _clrscr();

或者你可以拨打系统(CLS);

这篇关于在Windows上用C清除命令提示符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆