Ever wondered how to create a progress monitor in your C/C++ program??
Here's a small program that shows you how:
# include <iostream>
using namespace std;
void goback();
int main()
{
// *** CLEAR THE SCREEN ***//
// method 1
//printf("%c%c%c%c%c%c",27,'[','H',27,'[','J' );
// method 2
printf("\e[H\e[J");
// *** Rotating Progress Monitor ***//
while(1)
{
printf("|");
goback();
printf("\\");
goback();
printf("-");
goback();
printf("/");
goback();
}
}
void goback()
{
// makes cursor go back one character
printf("\e[D");
}

<< Home