怎么获取控制台窗口的宽度和高度??
如题!!
#include <termios.h>
#include <sys/ioctl.h>
void GetWinSize(int *w, int *h)
{
struct winsize size;
ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&size);
*w = size.ws_row, *h = size.ws_col;
}
[ 本帖最后由 ldg628 于 2010-3-21 22:41 编辑 ]