Hello, im having an issue understanding why my code wont compile, the code below gives me an error
std::cout << "\n\nPlease enter your guess: ";
std::cin >> letter;
std::cout << "\n";
for(int a = 0; a < letter.length(); a++){
letter[a] = tolower(letter[a]);
I have declared letter earlier above this code like so
char letter;
The error im receiving is;
error: request for member ‘length’ in ‘letter’, which is of non-class type ‘char’
for(int a = 0; a < letter.length(); a++){
^~~~~~
ufo.cpp:31:9: error: ‘letter’ cannot be used as a function
letter(a) = (char)tolower(letter(a));
^
ufo.cpp:31:35: error: ‘letter’ cannot be used as a function
letter(a) = (char)tolower(letter(a));
^
I havent used tolower/toupper before but i do have the #include library in my header.