Archived

This topic is now archived and is closed to further replies.

Daishim

LCase and UCase in C/C++

Recommended Posts

Daishim    244
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?

Share this post


Link to post
Share on other sites
Martee    476
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

Share this post


Link to post
Share on other sites
Kylotan    9860
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.

Share this post


Link to post
Share on other sites