What i need to do is convert the first letter of ever word into a caps letter. I know that in ASCII the lower case letters are between 97 and 122 and all i need to do it -32 to get the caps version. Now my problem is how do i change that letter to ASCII subtract 32 then print the letter value. This is what i have so far.
#include <iostream>
using namespace std;
//Main
int main()
{
int count;
int row;
cout << "How many words will be inputed?";
cin >> row;
int const ROWS = row;
int const SIZE = 30;
char word[ROWS][SIZE];
cout << "Please enter a few words and i will change every letter into caps.";
for ( count = 0; count < ROWS; count++)
cin >> word[count];
cout << "Here is a list of the words you entered with the first letter in caps.";
for ( count = 0; count < ROWS; count++)
{
if (static_cast<int>(word[count][0]) > 97 && static_cast<int>(word[count][0]) < 122)
{
***This is where i need help with the conversion***
}
}
return 0;
}
im getting a few errors like 'static_cast' : cannot convert from 'char [30]' to 'int'