How can I set the cursor at the desired location on the console in C or C++?
I remember a function called gotoxy(x,y)
, but I think its deprecated. Is th
This was on stackoverflow...
`#include
// ESC-H, ESC-J (I remember using this sequence on VTs)
#define clear() printf("\033[H\033[J")
//ESC-BRACK-column;row (same here, used on terminals on an early intranet)
#define gotoxy(x,y) printf("\033[%d;%dH", (y), (x))
int main(void)
{
clear();
gotoxy(23, 12);
printf("x");
gotoxy(1, 24);
return 0;
}`