Hi,
I think that the problem with \r is that, by default, the stdout is not flushed until a \n is found. So, what you can do is flush the stdout manually everytime you want to update the screen so it gets display.
This is a simple example that worked on my PC:
Code:
#include <stdio.h>
#include <time.h>
int main() {
int n;
for(n = 0; n < 100; n++) {
printf("\r%3d", n);
fflush(stdout); // This line flushes stdout inmediatly
sleep(1);
}
}
of course you dont need to sleep(1), thats just for demonstration.
If you want to make more advanced text interface, then you should turn into the ncurses library which lets you do fancy things in text mode.
Hope this is useful.
Cheers!