3
For some reason, the program is not keeping the character in the vector, as it should be stored, it is skipping the first character. For example:
// Declarando o vetor
char novosValores[4] = {0};
scanf("%c %c %c %c", &novosValores[0], &novosValores[1], &novosValores[2], &novosValores[3]);
Just for a space before the first
%c
. Since you didn’t, he’s reading the line break and putting in the first character– Jefferson Quesado
What code is on top of the
scanf("%c %c %c %c" , ...)
? There are other readings made withscanf
? if yes which ?– Isac
Thank you very much, it helped a lot!
– Junior
No, Isac, thanks for commenting.
– Junior
If you managed to solve it this way, take advantage and put the solution as an answer to help other people who have the same problem.
– Isac