英文:
NCurses: new window not showing up
问题
以下是您提供的代码的翻译部分:
我正在按照Dan Gookin所著的《程序员使用NCurses指南》中提供的示例创建第二个窗口。以下是代码:
#include <ncurses/ncurses.h>
int main()
{
    WINDOW* second_window;
    initscr();
    addstr("原始窗口,stdscr。\n");
    refresh();
    getch();
    second_window = newwin(0, 0, 0, 0);
    if (second_window == NULL)
    {
        addstr("无法创建新窗口...\n");
        endwin();
        return 1;
    }
    waddstr(second_window, "这是第二个窗口!!!\n");
    getch();
    wrefresh(second_window);
    endwin();
    return 0;
}
然而,没有出现新窗口,也没有出现任何错误。
请注意,我只翻译了代码部分,没有包含问题的回答。如果您需要进一步的帮助或有其他问题,请随时提出。
英文:
I'm following the example presented in the book "Programmer's Guide to NCurses" by Dan Gookin for creating a second window. Here's the code:
#include <ncurses/ncurses.h>
int main()
{
    WINDOW* second_window;
    initscr();
    addstr("Origian window, stdscr.\n");
    refresh();
    getch();
    second_window = newwin(0, 0, 0, 0);
    if(second_window = NULL)
    {
        addstr("Unable to create new window...\n");
        endwin();
        return 1;
    }
    waddstr(second_window, "This is the second window!!!\n");
    getch();
    wrefresh(second_window);
    endwin();
    return 0;
}
However, no new window is showing up, and I'm not getting any error either.
答案1
得分: 0
我在比较中使用了“=”而不是“==”。
英文:
I have used "=" instead of "==" in a comparison.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论