Jump to content
  • Advertisement
Sign in to follow this  
raptorstrike

reasigning const char*

This topic is 5061 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

ok im reasigning a const char* like so Enemy_List_C = Enemy_List[One->Enemy_Vector->ID].c_str(); this is in a for loop were i differs and there for so dose the ID# can i do this? because Enemy_list_C is a const char*

Share this post


Link to post
Share on other sites
Advertisement
I'm pretty sure you can, but it won't affect the previous string, of course(I think you couldn't if it was char* const str)

Share this post


Link to post
Share on other sites
Yes, you can. The only time the pointer would not be modifiable is if Enemy_List_C was a char *const. In this case, you would not be able to change the value of the pointer.

EDIT: spelling

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!