|
escape sequence help in C
Hey I hope someone can help me with this little problem. Web searches have come up dry. I do my programming in Linux by the way... :-)
code example:
int main()
{
time_t calendar_time;
struct tm *local_time;
calendar_time=time(NULL);
local_time=localtime(&calendar_time);
/*display time*/
printf("time: %s\WHATGOESHERE", asctime(local_time));
main();
return 0;
}
I want to print OVER the SAME line. If i use \n or the like i obviously will get newlines--no want i want. Basically I am trying to print the time in a loop (in this case recursive function). If i print over and over the same line it will be a sort of clock.
So how would I do this? I am thinking there is some rarely used escape sequence that not many people know about. If this is the case please help me out and tell it to me :-D. If there is no escape sequence to do this, how else can I?
Thanks much.
|