Sorry to reply to my own post, but...
wrote:
> edgekaos wrote:
> > Is method 2 valid?
> >
> > Method 2:
> > wstring input = L"STRING";
> > wstring output;
> > transform(input.begin(), input.end(), output.begin(), towupper);
>
> No, it's not. The output iterator needs to be the same length as the
> input iterator.
OR, you can also use std::back_inserter(). Like so:
string input = "Hello World!";
string output;
transform( input.begin(), input.end(), back_inserter( output ), toupper
);
Cheers,
Andre