去除VC6.0输出时显示的输入和最后的press any key to continue
要去除VC6.0输出时显示的输入和最后的press any key to continue,可以在代码中加入以下语句:
system("color 07"); //将控制台的前景色和背景色都设置为白色
system("cls"); //清屏
这样就可以清除掉输入和输出的内容,同时也避免了显示press any key to continue这句话。以下是完整的示例代码:
#include <stdio.h>
#include <stdlib.h>
int main()
{
system("color 07");
system("cls");
printf("Hello World!\n");
return 0;
}
把printf去掉,就没有提示了
至于press any key to continue...
这个没必要去掉,实际运行(双击exe运行)是没有的