You could just do this:
if (str[0] >= 97 && str[0] < 173)
str[0] -= 32;
Take a look at an ascii chart once, you'll see how the are all spaced.
Your problem is that you've defined toupper() as an integer something or other, so you aren't using the stdlib code, you are doing something weird. Remove the int toupper() line from just above the string and see if it works, you didn't outline what libraries you are using so not sure that you have the right includes.