I am trying to convert the string variable 'answer' with a specific array element. They both need to be either all upper or all lower case letters to ensure an accurate comparison. I'm getting the following error on line __: "invalid arguments' Candidates are; int tolower(int)." As these are strings, I don't quite understand the error.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
string answer;
int correct = 0;
for(int x = 0; x < sizeofarrays; x++)
{
cout << "What is the capital of " << array1[x] << "?" << endl;
getline(cin, answer);
if (tolower(answer) == tolower(array2[x]))
{
cout << "Correct!" << endl;
correct++;
}
else
{
cout << "Incorrect" << endl;
}