NOT WORKING
Hi guys , I have a little problem with cpp code The program has to count whe vowels and the consonants in the word , but its not working correctly here is the code: #include <iostream> using namespace std; int main() { char word[100]; cout << "Inserisci la parola: "; cin >> word; char* pWord = word; pWord[0]; int vowels = 0, consonants = 0; for (int i = 0; i < sizeof &pWord; i++) { switch (*pWord) { case 'a': vowels++; break; case 'e': vowels++; break; case 'i': vowels++; break; case 'o': vowels++; break; case 'u': vowels++; break; default: consonants++; break; } pWord++; } cout << "The word is: " << word << endl; cout << "The vowels are: " << vowels << endl; cout << "The consonants are: " << consonants << endl; }