Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Nanven

How would I fix this?

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

I''m trying to say string **sp = new string[limit]; but I get this error: error C2440: ''initializing'' : cannot convert from ''std::string *'' to ''std::string ** '' So how would I fix it, and more over, why is it saying that? If i try and break it up: string **sp; *sp = new string[limit]; My stack gets corrupted because sp doesnt point to anything. So just for fun I tried this: string location; string **sp = &location; *sp = new string[limit]; But it couldn''t do a pointer-pointer to a string, change it to this: string *location; string **sp = &location; *sp = new string[limit]; Works but then I get memory errors again. So how would I go about this?

Share this post


Link to post
Share on other sites
Advertisement
Ahh thanks. I tried something similiar to that but did it wrong.

I tried string **sp = new *string[limit];

Which didn''t work. Thanks for your help.

Share this post


Link to post
Share on other sites

  • 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!