Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Help with cout

Author: Todd Freitag

Date: 08:08:40 10/02/99

Go up one level in this thread


On October 02, 1999 at 02:37:48, James Robertson wrote:

>Whenever cout is used, say:
>for (percent = 0; percent <= 100; percent ++)
>  cout << "% complete: " << percent << endl;
>
>the output will look like:
>
>% complete: 0
>% complete: 1
>.....
>
>How do I make it so that the second cout statment will 'back up', i.e. overwrite
>the first statement so it is no longer visible?
>
>Thanks,
>James

Try:
cout << "% complete: " << percent << "\r";
within the for loop, then just print the endl once outside of the loop.

Todd



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.