In most modern shells, you can hit the up and down arrows and it will put, at the prompt, previous commands that you have executed. My question is, how does this work?!
You can use carriage return to simulate this.
#include int main(int argc, char* argv[]) { while(1) { printf("***********"); fflush(stdout); sleep(1); printf("\r"); printf("..........."); sleep(1); } return 0; }