I'm doing console-based game using ncurses library. I'm using getch() to implement the movement of main charachter. Need to enable no delay mode to set non-blocking getch().
nodelay(stdscr, TRUE);
But what if I want to use getch() or getstr() to read username before game start. Obviously I need to use getch() as usual, wait for user input. Something like this.
Player player;
char name[15];
scr.add("Enter your name: ");
getstr(name);
Is it possible to do? And can I use c++ std::string with ncurses and gestr() ? Because in Player class I'm working with std::string. Thanks in advance.
You can simply write nodelay(stdscr, FALSE); in your case just before the blocking code segment. About std::string i would say yes you can because it is program memory and not the curses screen