I have a code fragment something like this:
char choice;
do
{
cout << "A. Option 1" << endl;
cout << "B. Option 1" << endl;
cout << "C. Option 1" << endl;
cout << "D. Option 1" << endl;
cout << "Option: ";
cin >> choice;
if(islower(choice) == 0){ toupper(choice); } // for converting Lower alphabets to Upper alphabets so as to provide flexibility to the user
}while((choice != 'A') && (choice != 'B') && (choice != 'C') && (choice != 'D'));
but it does not converts the Lower alphabets to Upper alphabets... I don't know why... The OS I am using is Windows 7 and the Compiler is Visual C++(please note that I have tested this code in other compilers to but the same problem)...