I\'m trying to print characters in the console at specified coordinates. Up to now I have been using the very ugly printf(\"\\033[%d;%dH%s\\n\", 2, 2, \"str\");
I have a little different method. Not sure whether this is better than ncurses package, so i leave that for the upvoters to decide.
You can use Graphics package in C++ to output a text to a specific coordinate on your working screen.
The syntax is outtextxy(x, y, text) ;
Where x & y are coordinates.
One example is:
int main(void) {
int gdriver = DETECT, gmode;
int x = 200, y = 200;
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
outtextxy(x, y, "Hello World");
closegraph();
}
This little program will print Hello World in the coordinate (200,200).
For reference to what graphics package can do visit this link