I assume that you're using C.
No offense meant, but
systeming out to do this is not good.
In the first place,
system is creating it's own instance of the
shell. Even though the cursor is being moved in that shell, once
the command finishes, the shell is closed, and now the program
is back to it's own shell.
Secondly, you can read why using
system is bad on the
system man page.
However, as long as the terminal in which you are working supports
ANSI escape codes (which it should), then you can easily
printf
ansi escape codes to accomplish the cursor placement.
Code:
#include <stdio.h>
int main(void)
{
printf(
"\e[s" // save cursor position
"\e[5;10f" // go to line 5, column 10
"Located at 5,10" // print something at location
"\e[u" // return to stored cuirsor position
"Done!\n"
);
return 0;
}
Just
google search for ansi escape codes for all sorts of other interesting
things you can do with them.