HMMMM This looks like what I want, to change lower case to upper case. Could someone give me a hint as to where I am going wrong?
It is in fact school work, I can not use an algorithm, and i do not want a correction so to speak. I do need to be nudged along though.
Thank you.
Todd
#include<iostream>
using namespace std;
int main()
{
const int SIZE = 81; //+1 for null terminated.....
char userInput[SIZE];
cout << "Enter a string of characters\n";
cout<<"and i will change lower case to upper case." << endl;
cin.getline(userInput, SIZE);
for (int i = 0; userInput[i] <SIZE; i++)
{
if (userInput[i] >= 97 && userInput[i] <= 122);
userInput[i]-=32;
}
cout << userInput;
if (userInput[i] >= 97 && userInput[i] <= 122);
Don't put a semicolon a the end, there. That semicolon immediately after the if predicate tells the compiler "if the predicate is true, do nothing".
Do this instead:
1 2
if (predicate)
do_something;
If you want to avoid confusion, you can also always keep the braces: