Thread: c_str problem

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    1

    c_str problem

    <<< split from the graveyard - convert int to const char* >>>
    i tryed the above method and got this error

    argument of type ‘const char* (std::basic_string<char, std::char_traits<char>, std::allocator<char> >:()const’ does not match ‘const char*’|

    i was trying to do almost the same exact thing as meehanmd

    Code:
            sstr << HP;
            str_change =sstr.str();
    
    
           
             Surf_HP = TTF_RenderText_Solid(font, str_change.c_str,color);
    Last edited by Dynamitemedina; 02-06-2010 at 06:45 PM. Reason: more info

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    Code:
    Surf_HP = TTF_RenderText_Solid(font, str_change.c_str(),color);
    Forgot the parenthesis.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM