Why does not this code work for me? I do not see where the fault may be, I know that the conio library is not standard, but anyway it should work ...
#include <stdlib.h>
#include <conio.h>
int main()
{
char password[10];
char c;
int i=0;
c=getch();
while( (c=getch()) != '\n')
{
password[i] = c;
printf("*");
i++;
}
password[i] = c;
return 0;
}
The error is that after entering the enter it keeps asking for characters and then it hangs up ...