Hey... this should work. It looks kinda sloppy, but it will print a '*' for each character typed. You will want to add code to make sure they do not type in more characters than are allowed, etc. But keep this basic structure to echo '*' characters.
int main() {
char c;
char pwbuff[32];
int j;
c = getch();
for (j=0; c != '\r'; j++) {
pwbuff[j] = c;
putc('*', stdout);
c = getch();
}
pwbuff[j] = 0;
printf ("%s\n", pwbuff);
return 1;
}