While you have the question tagged as C++, the code seems to be more in line with C. If you are using C++, the comment to use std::toupper by Jarod42 is a great suggestion.
If you are trying to do it as C, then I believe your if statement is not correct. Consider the case of where c is just one greater than 'Z', which would be the '[' character. In that case you are subtracting 32 which is not probably what you would like to do. I would change the if to do just the range of lower characters.
In addition, even if your if is run, the next statement following the if block will set the character back to c, so you need to add an else statement and block, or do the assignment before you do the comparison to change to the look-up table.