Hello,
I got a problem trying to programm under Linux. I was trying to implement a fuction that will overwrite an input sentence. The function shall overwrite the read letters by hitting the Enter Button.
Code:
int main(void) {
char Password[10];
int i=0,j;
do{
Password[i]=getche();
if(Password[i]!=8) i++;
else{ // special case: Backspace
printf(" \b");
if(i>0) i--;
}
}while(Password[i-1]!=13);
for(j=0;j<i-1;j++)printf("*"); // overwrite it with '*'
printf("\n%s",Password);
}
It works fine under Windows but there is no getche() function under Linux.
Do you know another possibility?
With best regards