191289:
Here is one way of doing it....
#include <stdio.h>
#include <conio.h>
int main()
{
int c, counter = 0;
char buffer[32];
do
{
buffer[counter] = c = getch(); /*Use non-ANSI function to get from keyboard without writing to screen*/
putc('*',stdout);
counter++;
}
while ( c != 13 && counter < 31);
buffer[counter] = 0; /*Put a null character at the end of the string!*/
printf("\npassword is --> %s", buffer); /*Print out password*/
return 0;
}