LCase and UCase in C/C++
Does C/C++ have lowercase or uppercase function like VB, or something similar that will set all characters in a character array/string to lowercase or uppercase?
There are no built-in functions for converting an entire string, but it''s pretty easy to make one yourself using the toupper() or tolower() functions.
~~~~~~~~~~
Martee
~~~~~~~~~~
Martee
Someone once mentioned something like:
std::transform(theString.begin(), theString.end(), toupper);
But I find this doesn''t work under GCC because the string is composed of ''char'' and toupper returns an ''int''. Maybe there is a way around this though.
std::transform(theString.begin(), theString.end(), toupper);
But I find this doesn''t work under GCC because the string is composed of ''char'' and toupper returns an ''int''. Maybe there is a way around this though.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement