for(string::iterator X = str.begin(); X != str.end(); ++X) { #if (defined(BEOS) || defined(OPENBSD) || defined(CYGWIN) || defined(__MORPHOS__)) if ((*X >= 'a') && (*X <= 'z')) *X -= 32; #else *X = std::toupper(*X); #endif }
string s(str); to_uppercase(s); return s;
void to_uppercase(string &str){	for(string::iterator X = str.begin(); X != str.end(); ++X)	{#if (defined(BEOS) || defined(OPENBSD) || defined(CYGWIN) || defined(__MORPHOS__))		if ((*X >= 'a') && (*X <= 'z')) *X -= 32;#else		*X = std::toupper(*X);#endif         	}}