Good Morning,
I'm a little difficulty in writing and implementing a function that read a list of words of variable lengths and convert all letters to upper case. Ask the user to enter the size of the list. I shall use an array as pointers.
So far, I have this, but it's not working. Can anyone help me out.
char toUpper(char * chPtrs[5], char tmpStr[1000], char word)
{
for (int j=0; j<5; j++)
{
cout<<"enter a word => ";
cin>>tmpStr;
chPtrs[j] = new char[strlen(tmpStr)];
strcpy(chPtrs[j], tmpStr);
static char lower[] = tmpStr;
for (int i = 0; lower[i] != '0'; i++)
{
if (word >= 'a' && word <= 'Z')
cout << "The word converted to upper case is:"<< static_cast<char> ( word + 'A' - 'a') <<endl;
}
}