This is just a small fragment of my code so I didn't include all the vowels.
I am getting the error that "response" is not a valid identifier? When I'm trying to check the characters in the string for either A or E and increment the count in the appropriate area of the array...Code:string response; int array [5]= {0, 0, 0, 0, 0}; cout << "enter a string of text\n" << endl; cin >> response; for(int i=0;i<strlen(response);i++) { if response == 'A' //invalid identifier array[i]++; if response == 'E' //invalid identifier array[i]++; }



LinkBack URL
About LinkBacks



CornedBee
