Matthew Ozor escribió:
>How do I set the starting row and column when printing
>in a console? Can this be done with printf ?
>
>Thank You
>Matt
>
>
You must use Microsoft Console API. Here´s is the code. You can find a
description of the SetConsoleCursorPosition() and GetStdHandle()
functions in the MSDN
//Positions the cursor at the (x,y) coordinates
void gotoxy(int x, int y){
COORD pos;
if ( x <= 1) pos.X = 0;
else pos.X = x;
if ( y <=1) pos.Y = 0;
else pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
return;
}
--
---------------------------------------------------
Ricardo Amores Hernández
ICQ: 19463735
MSN: zheo_ (at) hotmail (dot) es
---------------------------------------------------
|