Hi,
I am using toupper() on user input and then I want to display the answer after its been touppered.
But the program shows me the ascii value for the letter rather than the character. Even though I am using toupper() on a char variable.
Code:#include <iostream> //#include <ctype.h> // Makes the toupper function available to the compiler using namespace std; void main () { char userInput = ' '; cout << "Please enter a character: "; cin >> userInput; cout << "The letter you entered was: " << toupper(userInput) << endl; }
2. On a different note. I am using VS 2005 express. Why is it that for some header files (eg, iostream) when I put the extension, the '.h' in with the name the compiler gives an error. And for other header files, if I dont put the '.h' I get an error. Not very consistent. IS the problem me? anyone tell me why this is?
Thanks for looking, your advice and help are appreciated



LinkBack URL
About LinkBacks


