In a validation function that passes all the tests will return 1, and if it enters one of the conditions it will give return
to 0.
I want to loop through the line break, so I'm using the range:
for(int i=0;dados[4][i]!='\n';i++){
if(!isdigit(dados[4][i])){
return 0;
}
}
The file has already been split and saved in a dados[4][20]
array, with lines of the genre
4 ; Visitante ; 3 ; 0 ; 3 \n
4 ; Visitante ; 3 ; 0 ; 3 \n
4 ; Visitante ; 3 ; 0 ; 3 for(int i=0;dados[4][i]!='\n';i++){
if(!isdigit(dados[4][i])){
return 0;
}
}
However, in the last line of the file, there is no longer a line break but a %code%
, so it will not allow us to validate the last line