stl transform error

Discussion in 'C++' started by asit, May 7, 2012.

  1. asit

    asit Guest

    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 ===|
     
    asit, May 7, 2012
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Allan Bruce

    To STL or not to STL

    Allan Bruce, Oct 16, 2003, in forum: C++
    Replies:
    41
    Views:
    1,064
    Christopher Benson-Manica
    Oct 17, 2003
  2. Patrick Guio

    STL transform algorithm

    Patrick Guio, Nov 2, 2005, in forum: C++
    Replies:
    9
    Views:
    541
    Clark S. Cox III
    Nov 2, 2005
  3. Piotr

    STL transform algorithm

    Piotr, Feb 14, 2006, in forum: C++
    Replies:
    5
    Views:
    440
    Daniel T.
    Feb 14, 2006
  4. Alex
    Replies:
    2
    Views:
    3,717
    Daniel T.
    Feb 26, 2006
  5. benben
    Replies:
    4
    Views:
    371
    Daniel T.
    Aug 31, 2006
Loading...

Share This Page