Archived

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

How would I fix this?

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