This is my sample program for simulating a Loading progress. The only problem I'm facing right now is clearing my previous output of "Loading: %i"
/* loading program */
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#define TIMELIMIT 5
int main()
{
for(int i = 0, j; i < 5; ++i) {
j = i;
printf("Loading: %i%%", ++j);
sleep(1);
//system("bash -c clear"); not working
//printf("\033[2J\033[1;1H"); clears whole screen with no output at all
}
return(0);
}