Click to See Complete Forum and Search --> : Converting strings to Upper case in C++


dan185818
04-24-2003, 12:55 PM
I need to make sure that the letters in a string are uppercase to do some searching in a vector. The format of the string will be "A9999", but the user needs to be able to put in "a9999" and have it find their account. I seem to remember a funtion that would make a string uppercase. if any of you know, please tell me so I can do this.
I appreciate it alot.

EverlastingGod
04-24-2003, 01:10 PM
You can try looping through the characters in the string, using "toupper" from ctype.h (or just cctype if your not using the ".h" version)

Remington
04-25-2003, 05:13 PM
Can't you simply use strupr() from string.h ?
It's not ANSI so maybe you wouldn't want to include it though.