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

No members online now.

Forum statistics

Threads
473,955
Messages
2,570,117
Members
46,705
Latest member
v_darius

Latest Threads

Top