I stumbled upon a code from 2016 written in the Turbo C++ IDE in windows It was to accept passwords
char pass;
for (length = 0;;)
{
pass=getch();
if (pass == 13)
{
break;
}
if ((pass >= 'A' && pass <= 'Z') || (pass >= 'a' && pass <= 'z') || (pass >= '0' && pass <= '9') || (pass == '!' || '@' || '#' || '$' || '%' || '^' || '&' || '*' || '(' || ')'))
{
str[length] = pass;
++length;
cout << "#";
}
}
is there any replacement for this without the getch method for linux to show output like this ******** ? I tried scanf but that didnt work cause it took the whole input first and gave the output later