MarcoHensel
Well-Known Member
hey Ihr,
ich hab da mal was vorbereitet:
Funktioniert soweit, aber ich hab so ein Gefuehl das es wesentlich kuerzer/eleganter geht. Vllt. kann mir jemand diesbezueglich was zeigen.
Viele Gruesse,
Marco
ich hab da mal was vorbereitet:
Code:
#include <stdio.h>
void print_progress(int count,int i)
{
int tmpi=i;
int tmpy=count-i;
char *t="#";
printf("Progress: ");
while ( tmpi > 0 )
{
printf("%s", t);
--tmpi;
}
while ( tmpy > 0 )
{
printf("%s", ".");
--tmpy;
}
printf(" %d%%", i);
fflush(stdout);
printf("\r");
}
void main()
{
int i;
int count=100;
for(i=0;i<=count;i++)
{
print_progress(count,i);
usleep(60000);
}
printf("\n\n");
}
Funktioniert soweit, aber ich hab so ein Gefuehl das es wesentlich kuerzer/eleganter geht. Vllt. kann mir jemand diesbezueglich was zeigen.
Viele Gruesse,
Marco