I have an issue with the command sleep in C.
I have this function which display a cow like cowsay in terminal
void vacheQuiMange(){
update();
affiche_vache("00", "__");
sleep(1);
gotoxy(3,22);
printf("*");
sleep(1);
gotoxy(3,22);
printf("U*");
sleep(1);
gotoxy(3,23);
printf(" *");
sleep(1);
gotoxy(3,24);
printf(")*");
sleep(1);
gotoxy(3,25);
printf("\\*");
sleep(1);
for(int i = 26; i < 34; i++){
gotoxy(3,i);
printf(" *");
sleep(1);
}
gotoxy(8,0);}
and this two function
void update () { printf ( "\033[H\033[J" ) ;}
void gotoxy (int x, int y) { printf ("\033[%d;%dH",x,y ) ;}
The problem is that the terminal don't display any update when there is a sleep, but show the final result after few second.