Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > stl transform error

Reply
Thread Tools

stl transform error

 
 
asit
Guest
Posts: n/a
 
      05-07-2012
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 ===|

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write the transform equivalent in STL? benben C++ 4 08-31-2006 03:30 AM
STL, std::transform and member functions Alex C++ 2 02-26-2006 08:40 PM
STL transform algorithm Piotr C++ 5 02-14-2006 05:10 PM
STL transform algorithm Patrick Guio C++ 9 11-02-2005 09:07 PM
blocking I/O with javax.xml.parsers.DocumentBuilder.parse() and javax.xml.transform.Transformer.transform() jazzdman@gmail.com Java 1 03-27-2005 06:56 AM



Advertisments