Why are you accepting 2 array of strings into a function like that? Why are you uppercasing 25 characters for each string? Or are you trying to call toupper() on 25 strings? toupper() is meant to work on only one letter at a time, not entire strings.
I think you're rushing through this way too quickly. If you waited until the last minute to do this assignment, then you're in trouble, and we probably can't help you. If you have a week or so before it's due, or heck, possibly even a few days left to hand it in, then you have time to slow down, think things through, and get it done right.
What are you really trying to do? Just convert a string to uppercase? Do you need to keep the original string? From what I can see you don't need the original lastname in the program, so why not just convert it?
Code:
void ChangeLastname(string &lastname)
{
for(size_t i=0;i<lastname.length();i++)
{
lastname[i] = toupper(lastname[i]);
}
}
Now if you have a string named
lastname in main() or somewhere else, you can call the above function like this:
Code:
ChangeLastname(lastname);
Bingo. lastname will now be completely capitalized. ;)
When you read in lines, you should read in one line at a time in a loop and deal with it. Inside this loop, that's where you need to call ChangeLastname().