2
I need to find out if each element of a chained list is a vowel or not.
How can I fix my code?
int BuscaNv(LISTA* resp){
NO* atual = resp->inicio;
while(atual){
if(atual->letra == 'a' || 'e' || 'i' || 'o' || 'u'){
printf("É vogal\n");
atual = atual->prox;
}
else{
printf("Não é vogal\n");
atual = atual->prox;
}
}
return 0;
}
Typedefs:
typedef struct estr {
char letra;
struct estr *prox;
} NO;
typedef struct {
NO *inicio;
} LISTA;
Why aren’t you getting it?
– Jéf Bueno
Code returns "is vowel" for all characters
– Kfcaio
These
||
are wrong.– Jéf Bueno
Behold, this publication. The problem is the same as yours, what changes is the syntax of the language.
– Jéf Bueno