If you're on Windows, you can use it's API, for things like SetConsoleCursorPosition(). The Borland compiler has more sophisticated tools you can use for this, and I would recommend them. This is an example of the Turbo C (Borland) window() function:
Code:
/*
window Defines active text-mode window.
Syntax:
void window(int left, int top, int right, int bottom);
The top left corner of the screen is (1,1).
Prototype in:
conio.h
Remarks:
window defines a text window onscreen. If the
coordinates are in any way invalid, the call
to window is ignored.
left and top are the screen coordinates
of the upper left corner of the window.
right and bottom are the screen
coordinates of the lower right corner.
The minimum size of the text window is one
column by one line. The default window is
full screen, with these coordinates:
80-column mode: 1,1,80,25
40-column mode: 1,1,40,25
Return Value: None.
Portability:
window works with IBM PCs and compatibles only.
A corresponding function exists in Turbo
Pascal.
See Also:
clreol delline gotoxy puttext
clrscr gettextinfo insline textmode
*/
Example:
#include <conio.h>
int main(void)
{
window(10,10,40,11);
textcolor(BLACK);
textbackground(WHITE);
cprintf("This is a test\r\n");
return 0;
}
Turbo C is free, but somewhat limited by it's 16 bit DOS roots. Works great in WindowsXP, but won't work at all in Windows 7 without a virtual software install like VMWare, to give it the 16 bit environment it needs. Google Borland legacy languages for d/l sites.
As you can see, I still use turbo C, precisely for functions like this.