• Advertisement
Sign in to follow this  

String question

This topic is 4469 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone, Is there anyway to convert a string into a const char*? I'm using GLUT popup menus in a little editor I wrote for a game I'm making, and I'm trying to have the popup menus contain buttons that are defined in an outside file. The problem arises when I try and create the sub menu buttons because the information for the button's name is saved as a string, but the function that creates the menu requires a const char *. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Assuming std::string, use the c_str() member function.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement