I'm trying to update a text on the terminal without have to print again the text. Right now I'm trying to do it on a simple code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(int argc, char *argv[]){
for(int i=0;i<=100;++i){
printf("\r[%3d%%]",i);
sleep(1);
}
printf("\n");
return 0;
}
The code literally print nothing, with the pointer blinking at the start of the line.
Can someone help me?