Answer to Question #21415 in C++ for fash

Question #21415
Please give me a hand in this coding>?
i have been trying to create a loading function for my program>
its been months and all i could do that is with stdio.h>pritf..
like in old c++. and i had to mix my program with iostream>cout..
i have found this below coding from internet and its not working.
anyone know how to do this easier way with iostream only?
--------------------------------------…
#include <iostream>
using namespace std;
void DrawProgressBar(int len, double percent) {
cout << "\x1B[2K"; // Erase the entire current line.
cout << "\x1B[0E"; // Move to the beginning of the current line.
string progress;
for (int i = 0; i < len; ++i) {
if (i < static_cast<int>(len * percent)) {
progress += "=";
} else {
progress += " ";
}
}
cout << "[" << progress << "] " << static_cast<int>(100 * percent) << "%";
flush(cout);
--------------------------------------…
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS