-1
Hello! What is happening is that the input formatter %[^\n]
does not save your enter typed, but it is still captured by your keyboard buffer. This buffer gets "polluted" and interferes with reading the next string.
One suggestion to get around this is to clear your buffer after a read.
printf("Digite o nome do funcionário: ");
scanf("%s", nome);
__fpurge(stdin);
Note: Remembering that __purge(stdin)
is for Unix and fflush(stdin)
is for windows
Change the comma in 1452.32 for a dot: 1452.32.
– anonimo
worked out! thank you very much!!
– Ludmila Ribeiro