c_str problem

This is a discussion on c_str problem within the C++ Programming forums, part of the General Programming Boards category; <<< split from the graveyard - http://cboard.cprogramming.com/cplus...nst-char*.html >>> i tryed the above method and got this error argument of type ...

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

    c_str problem

    <<< split from the graveyard - http://cboard.cprogramming.com/cplus...nst-char*.html >>>
    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,806
    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, 05: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, 09:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 03:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 07:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21