I would like to write a C++ program on linux gcc, such a way that time should be displayed on the right top (keeps changing ) and also make other processes to go on.
For Example:
I want time to be displayed on right top and also want to perform some operations like basic calcs on the same screen...
. I knew to display time continously using this snippet
#include<iostream.h>
int main()
{
while(1)
{
system("clear");
system("date +%r&");
sleep(1);
}
return 0;
}
but each time , 1) it clears the screen , so the other instructions on screen also gets cleared 2) i also like to know how to make both the processes run at the same time??
Using bg etc would help?