Hello, I'm trying to have a function outside of main check to see if a number is lowercase, and then to make it uppercase if it is. So far I have this but I'm showing errors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
bool Upper(char x)
{
if (islower(x))
putchar (toupper(x));
return x;
}
int _tmain(int argc, _TCHAR* argv[])
{
char x;
int y;
cout << "Please press a key" << endl;
cin >> x;
Upper(x);
cout << Upper(x);
errors are
1>(34): error C2084: function 'bool Upper(char)' already has a body
1>(17) : see previous definition of 'Upper'
1>(46): error C3861: 'Upper': identifier not found
1>(47): error C2568: '<<' : unable to resolve function overload
1>(17): could be 'bool Upper(char)'
1>(47): error C3861: 'Upper': identifier not found