Hi all, below I've pasted a portion of code from a project I am working on. Regardless of what the user enters, I need the char to stay lowercase in the programs eyes because I am using //if (word.find(guess) != string::npos)// later on in my program (hangman game). This function only works with lowercase chars. If you run the program, the output is strange. I'm not sure why the char I'm trying to convert won't stay lowercase.
putchar prints out the lower case character but it doesn't save the value back to the guess variable.
Also guess is passed by value, so the original value back in main won't get changed. If you pass by reference and save the value of tolower(guess) back to the variable guess, I think you'll get the result you want.