Is it the same in C++ where you need x and y coordinates. Can someone give me some examples of CursorPositions in C or point to me to a website... thanks
Printable View
Is it the same in C++ where you need x and y coordinates. Can someone give me some examples of CursorPositions in C or point to me to a website... thanks
It depends on your operating system. If you are using Windows, check out my consoles tutorials. Part 2 covers cursor movement, amongst other things. They are now in C++ but the functions are the same, just use printf() instead of cout!
The answer to your question is yes. The x y coords are the same. If you have Borland simply include the <conio.h> library and use the gotoxy(x, y); function. In windows this is how I do it...
void SetPosition(int X, int Y)
{
HANDLE Screen;
Screen = GetStdHandle(STD_OUTPUT_HANDLE);
COORD Position={X, Y};
SetConsoleCursorPosition(Screen, Position);
}
Sure hope this helped..thanks