#include <curses.h>
int main(){
initscr();
refresh();
char s[25];
mvprintw(1,0,"Enter sentence: ");
refresh();
scanw("%s", s); // Input `one two`.
mvprintw(2,0,"%s\n", s); // This just prints `one`.
refresh();
getch();
endwin();
return 0;
}
Input is one two
.
Output is just one
, second half is missing.
Does scanw
not treat spaces properly?