First time with ncurses
Woo! Magic! Just doing masked PIN input in the terminal for a crypto project.
void readPin(char (&pin)[5]) { initscr(); noecho(); for (unsigned int i = 0; i < 4; ++i) { pin[i] = getch(); addch('*'); } endwin(); pin[4] = '\0'; }
Pretty simple. This is just a 4 digit pin used for verifying a user's identity when they log in. Instead of showing the typed characters, it shows asterisks.















