简体   繁体   English

我可以用 ncurses Windows 变体中的 sleep 命令替换什么?

[英]What can I replace with the sleep command in the Windows variant of ncurses?

#include <curses.h>
#include <unistd.h>
#include <iostream>
int main() {
    initscr();
    mvaddstr(10, 10, "Hello, world");
    refresh();
    sleep(4);
    endwin();
    std::cout << "DONE\n";
}

I'm working on a project and I need to take down the curses windows for a while just to write a path to directory in cmd and then let the curses windows come back.我正在做一个项目,我需要暂时取消 curses windows,以便在 cmd 中写入目录路径,然后让 curses windows 回来。 I found this code on this site and tried to use sleep command in the code but it didn't work.我在这个网站上找到了这段代码,并尝试在代码中使用 sleep 命令,但没有成功。

So if anyone knew how to solve this please write it down here.所以如果有人知道如何解决这个问题,请在这里写下来。 Thnx:)谢谢:)

napms is the (portable) curses function to use instead of sleep napms是(便携式)curses function 代替sleep使用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM