Is there any way to make the first 5 cases run as one? And why isn't it telling caps apart from undercase?

07-14-2003

thefroggy

Change:

Code:

case '0': cout << endl << "that isn't a small letter!";
break;

to:

Code:

case 0: cout << endl << "that isn't a small letter!";
break;

Note that in the your code, the '0' is the character 0 (not the number) while your switch statement will be looking for the number 0 if the input is not lowercase.

As for the first 5 cases running as one... they already do. By making the change I mentioned above, the program works as expected for me.

07-14-2003

Zach L.

What exactly is it doing. That 'letter*(...)' bit is a bit odd, but I think it will work fine. 'case '0':' ought to have no quotation marks though. Since multiplying your letter by zero will give you the value 0, not the character '0' (which has a non-0 ASCII representation).