How would I print a spinning curser in a utility that runs in a terminal using standard C?
I\'m looking for something that prints: \\ | / - over and over in the same pos
You could use the backspace character (\b) like this:
\b
printf("processing... |"); fflush(stdout); // do something printf("\b/"); fflush(stdout); // do some more printf("\b-"); fflush(stdout);
etc. You need the fflush(stdout) because normally stdout is buffered until you output a newline.
fflush(stdout)