📜  终端尺寸 in - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:36.294000             🧑  作者: Mango

代码示例1
#include 
#include 
#include 

int main (int argc, char **argv)
{
    struct winsize w;
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);

    printf ("lines %d\n", w.ws_row);
    printf ("columns %d\n", w.ws_col);
    return 0;  // make sure your main returns int
}