我说的是vc6下啊,肯定不行了。我下了一个gotoxy()函数,不过我不理解。
voidgotoxy(inta,intb){COORDc;c.X=a;c.Y=b;SetConsoleCursorPosition(GetStdHandle(STD_OU...
void gotoxy(int a, int b)
{
COORD c;
c.X=a;
c.Y=b;
SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);
}COORD什么意思还有SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c)什么意思啊?多谢啊。 展开
{
COORD c;
c.X=a;
c.Y=b;
SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);
}COORD什么意思还有SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c)什么意思啊?多谢啊。 展开
1个回答
展开全部
SetConsoleCursorPosition
The SetConsoleCursorPosition function sets the cursor position in the specified console screen buffer.
该函数的作用是在特定的窗口中实现光标的定位.
BOOL SetConsoleCursorPosition(
HANDLE hConsoleOutput, // handle to screen buffer窗口handle
COORD dwCursorPosition // new cursor coordinates光标的坐标
);
Parameters变量
hConsoleOutput
[in] Handle to a console screen buffer. The handle must have GENERIC_WRITE access.
指向窗口的handle,必须有GENERIC_WRITE的权利
dwCursorPosition
[in] Specifies a COORD structure containing the new cursor position. The coordinates are the column and row of a screen buffer character cell. The coordinates must be within the boundaries of the screen buffer.
包含一个光标的坐标.坐标位置必须不超出窗口.
Return Values
If the function succeeds, the return value is nonzero.
如果函数执行成功,返回非0
If the function fails, the return value is zero.
如果执行失败,返回0
To get extended error information, call GetLastError.
Remarks
The cursor position determines where characters written by the WriteFile or WriteConsole function, or echoed by the ReadFile or ReadConsole function, are displayed. To determine the current position of the cursor, use the GetConsoleScreenBufferInfo function.
If the new cursor position is not within the boundaries of the screen buffer's window, the window origin changes to make the cursor visible.
The SetConsoleCursorPosition function sets the cursor position in the specified console screen buffer.
该函数的作用是在特定的窗口中实现光标的定位.
BOOL SetConsoleCursorPosition(
HANDLE hConsoleOutput, // handle to screen buffer窗口handle
COORD dwCursorPosition // new cursor coordinates光标的坐标
);
Parameters变量
hConsoleOutput
[in] Handle to a console screen buffer. The handle must have GENERIC_WRITE access.
指向窗口的handle,必须有GENERIC_WRITE的权利
dwCursorPosition
[in] Specifies a COORD structure containing the new cursor position. The coordinates are the column and row of a screen buffer character cell. The coordinates must be within the boundaries of the screen buffer.
包含一个光标的坐标.坐标位置必须不超出窗口.
Return Values
If the function succeeds, the return value is nonzero.
如果函数执行成功,返回非0
If the function fails, the return value is zero.
如果执行失败,返回0
To get extended error information, call GetLastError.
Remarks
The cursor position determines where characters written by the WriteFile or WriteConsole function, or echoed by the ReadFile or ReadConsole function, are displayed. To determine the current position of the cursor, use the GetConsoleScreenBufferInfo function.
If the new cursor position is not within the boundaries of the screen buffer's window, the window origin changes to make the cursor visible.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询