0
Hello, I have a problem with my code. I have a matrix[6][3] that reads letters, after reading I want to separate the vowels from the consonants. However I did not succeed because all the letters go to the consonant variable. Someone can take a look at the code and give me a light...
#include<stdio.h>
#include<stdlib.h>
#include<locale.h>
int main(){
setlocale(LC_ALL,"Portuguese");
char torto[6][3]; //TORTO[LINHA][COLUNAS]
int c, l, vogalcont=0, consoantecont=0;
char vogal[8], consoante[10];
int x = 0;
printf("\nInsira aqui as letras para a composicao da matriz do jogo([LINHA][COLUNA]).....\n");
for (l = 0; l < 6; l++){
for (c = 0; c < 3; ++c){
printf("[%d][%d]: ", l,c);scanf("%s", &torto[l][c]);
}
}
//VALIDAÇÃO DA MATRIZ
for (l = 0; l < 6; l++){
for (c = 0; c < 3; ++c){
if((torto[l][c] == "A") || (torto[l][c] == "E") || (torto[l][c] == "I") || (torto[l][c] == "O") || (torto[l][c] == "U")){
vogal[vogalcont] = torto[l][c];
vogalcont++;
}
else{
consoante[consoantecont] = torto[l][c];
consoantecont++;
}
}
}
return 0;
}