Is clrscr(); a function in C++?

前端 未结 10 2114
忘掉有多难
忘掉有多难 2020-12-03 03:35

I\'ve looked everywhere for this function and cannot find the header files to make this work. It says clrscr() undeclared which brings me to the question. Is clrscr(); a fun

10条回答
  •  借酒劲吻你
    2020-12-03 04:24

    On Linux I always use:

    void clrscr(void)
    {
       fprintf(stdout, "\033[2J"); // clean screen
       fprintf(stdout, "\033[1;1H"); // move cursor to the first line
    }
    

提交回复
热议问题