I dont see the point of line 15. You dont use it anywhere in your function.
Ok. It seems you have a decent amount of errors. If im wrong someone correct me please. Ill start in the function.
It seems to me that you are passing in a char array and swaping the case of each letter in the array. so I will go on that assumption.
On line 12 I would change the code to
const int size = 26; //but that is just me.
You can get rid of line 15 its not used.
Line 19 should be
1 2 3 4
|
if(letter[count] == ' ')
{
//... I would get rid of letter++ i dont think that code does anything.
//i think when you do pointer++ it goes to next position but that is what were using the count for
|
this is what the for statement should be
1 2 3 4 5 6 7 8 9 10 11 12
|
for(int i = 0; i < array_size; i++){
if(letter[count] == lower_case[i]) {
letter[count] = upper_case[i];
break;
}
else if(letter[count] == upper_case[i]){
letter[count] = upper_case[i];
break;
}
}
|
then for the end of the while statement get rid of the
letter++ on line 36.
Line 44 might give you problems because you are making a 2d array I think wich you do not need. I think you wrote a function for a single dimension array. If I were you I would change it too
char* stars[] = {"Robert Redford", "Chuck Norris", "Alec Baldwin" };
line 45 you never use the count so why make it. You can get rid of this line.
Line 47 should be
toUpper(stars, len);
line 48 im not sure if you are trying to print the first element or what.
if your tring to print the first element you can simply do the following
cout << stars[0] << endl;
if your trying to print the whole array
1 2
|
for(int i = 0; i < len; i++)
cout << stars[i];
|
let me know if this helped or if I made any mistakes.