How do I print out transfer file progress in console application?  
Author Message
idos





PostPosted: Visual C++ General, How do I print out transfer file progress in console application? Top

Hi,

I am trying to make a console application that download / transfer file, and I want to show the transfer progress (bytes received), but every time I use cout << bytereceived << endl; I actually made a new line. can someone help me to "rewrite" the number that has been shown in the console

Thank you.



Visual C++8  
 
 
Viorel.





PostPosted: Visual C++ General, How do I print out transfer file progress in console application? Top

I hope this suggestion should work:

cout << bytereceived << '\r';


 
 
Sarath.





PostPosted: Visual C++ General, How do I print out transfer file progress in console application? Top

Viorel,
cout << bytereceived << "\r\n";
required no



 
 
Mike Danes





PostPosted: Visual C++ General, How do I print out transfer file progress in console application? Top

Nope, that's the whole point. Using a \n will move the cursor to the next line. If you use only \r the cursor goes to the begining of the current line enabling you to write on the same line.


 
 
idos





PostPosted: Visual C++ General, How do I print out transfer file progress in console application? Top

It works !!

Thank you