简体   繁体   English

使用功能时在控制台上出现白色区域?

[英]Getting white areas on my console when I use function?

I am getting some weird white areas on my cmd everytime I run my program and use a particular function. 每次我运行程序并使用特定功能时,cmd上都会出现一些奇怪的空白区域。 The white areas really have no effect on the program whatsoever other than it looks ugly and distracting. 除了看起来丑陋和分散注意力之外,白色区域实际上对程序没有任何影响。

I think in this circumstance a snapshot is needed: 我认为在这种情况下需要快照: 截图

Here is the function I'm using: 这是我正在使用的功能:

void ClearScr()
{
std::cout << std::string(50,'\n');
//all it does is simply creates 50 new lines so that the information doesn't become overwehlming
}

I also did try this: 我也尝试过这样:

void ClearScr()
{
  for(int i = 0; i < 50 ; i++){
    std::cout << "\n";
  }
}

It looks like you're on Windows, which means that 'standard' behaviour does not always apply. 好像您在Windows上一样,这意味着“标准”行为并不总是适用。

Here is a link to a Microsoft MSDN item on how to clear the console. 这是有关如何清除控制台的Microsoft MSDN项目的链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM