stl transform error

A

asit

what's wrong with the following code

#include <string>
#include <algorithm>
#include <cctype>

char *name = "HHTT KKK KHH";
std::string lname( name );
std::transform( lname.begin(), lname.end(), lname.begin(), tolower );

The error comes in the last line.

C:\web\httpgrab122\happyhttp.cpp|514|error: no matching function for call to 'transform(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, <unresolved overloaded function type>)'|
||=== Build finished: 1 errors, 5 warnings ===|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top