I was wondering if anyone would know how I can modify the following code to allow me to wait for a text entry to be entered, to store it in the corresponding variable and to jump to the next line immediately below it without deleting what was written before except when the size of the window created is exceeded.

```
#include <curses.h>

int main()
{
    WINDOW *wnd;
    char txt[100];
    // INICIALIZACIÓN DE LAS VENTANAS.
    initscr();
    cbreak();
    noecho();
    refresh();
    start_color();
    init_pair(1,COLOR_WHITE,COLOR_RED);

    wnd = newwin(10,100,1,1);
    wattron(wnd,COLOR_PAIR(1));
    wbkgd(wnd,COLOR_PAIR(1) | ' ');
    wclear(wnd);
    box(wnd,ACS_VLINE,ACS_HLINE);

    wmove(wnd,1,1);
    wprintw(wnd,">> ");
    wrefresh(wnd);
    wmove(wnd,1,6);
    echo();
    wgetstr(wnd,txt);
    noecho();

    return 0;
}

```

What I have programmed right now as soon as it detects the first intro stores the value in char but closes the ncurses window...

Does anyone know how I can fix it to get what I'm looking for?