while (getchar ()! = '\ n');
Tengo lo siguiente para loop, estoy pidiendo al usuario que ingrese un pin de 4 dígitos y presione enter. ¿Puede alguien explicarme qué está haciendo realmente el ciclo while porque no lo entiendo completamente?
//user input for pin
for(i = 0; i < PIN_LENGTH; i++)
{
printf("Enter digit %d of your PIN: ", i);
user_pin[i] = getchar();
while (getchar() != '\n'); //what is this line doing??
}