do { getch(pwd[i++]); printf("*"); }while(pwd[i--]!='\n');
do { getch(pwd[i]); printf("*"); }while(pwd[i++]!='\n');
#include <stdio.h> #include <conio.h> int main(void) { char pwd[100]; int i = 0; printf("Please enter the pwd:"); do { pwd[i] = getch(); printf("*"); }while(pwd[i++]!='\r'); printf("\n"); return 0; }