-
what if
Ok hello everyone
I have a little question today,
Well If i need an information that is necessary in capital letter but I dont want to mess with the user how I can make(is there something to do that) that the user write that dont matter is it in lower case or upper case.
well my bf tell me how to do that in visual basic
Code:
if x = ucase("a") -> x = "A"
but I dont have any idea, thx in adv.
regards,
Abyss
well Im using Dev C++
-
Hm... something like isupper, or islower? Or perhaps toupper and tolower. ;)
Quzah.
-
I think what you are looking for.. are the tolower() and toupper() functions.. located in the <cctype> library
Code:
#include<iostream>
#include<cctype>
using namespace std;
int main()
{
char choice;
cout << "Enter menu choice: ";
cin >> choice;
switch(toupper(choice)) //turns all user entries to upper case
{
case 'A': function_call();
break;
case 'E': cout << "Bye";
exit(0);
}
return 0;
}
-
Thanx Quzah you have the idea, and thx anonytmouse ( http://www.cprogramming.com/fod/toupper.html )and great example the brain, yeah thats what I want , your example make that more clear.