my goal is to get text from screen using ncurses in c++. To achieve this, I'm trying to use mvinstr() function, but I'm having problems with getting the arguments right - mostly the char *str. My guess is that it all comes down to my misuse of pointers, as I'm getting segmentation fault error. I'd really appreciate telling me what is wrong with my aproach here. Here is a link to a manpage: https://linux.die.net/man/3/winstr .
mvaddstr(1, 1, "text");
char *str;
mvinstr(1, 1, str);
mvprintw(2, 1, str); //expected output: text