|
-
October 11th, 2002, 09:48 AM
#1
string to upper case
Gurus,
Is there a function in gcc which would convert a STRING (std::string) to upper case?
Thanks in Advance
-
October 11th, 2002, 10:06 AM
#2
std::transform() should work. I have two versions
of g++. On one it works, on another (older) it has
a compiler error.
Code:
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
string str = "Hello World";
transform(str.begin(),str.end(), str.begin() , toupper);
cout << str << endl;
return 0;
}
-
October 11th, 2002, 10:50 AM
#3
if you can use the windows.h header, use
Code:
ToUpper(const char*);
C G C F A D--Feel the Noise
"When your life goes nowhere and leads back to me, doesn't that tell you something?"
~Gray Area Fury
-
October 11th, 2002, 11:03 AM
#4
-
October 11th, 2002, 11:17 AM
#5
oops, i made a mistake...
it's
Code:
CharUpper(const char*);
C G C F A D--Feel the Noise
"When your life goes nowhere and leads back to me, doesn't that tell you something?"
~Gray Area Fury
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|