Jump to content
  • Advertisement
Sign in to follow this  
Funkymunky

2d std::vector array resizing?

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

im getting a crash when i try to resize a 2 dimensional vector of ints, declared as such:
std::vector<std::vector<int>> map
i try to resize the "x" dimension like so:
for(int i=0; i<map.size(); i++)
    map.resize(newnum);
yet i get a crash (send error report type crash). why is that?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Funkymunky
yet i get a crash (send error report type crash). why is that?
Because you're not running your code in the debugger, which would tell you more precisely what's wrong; E.g. if it's an access violation, what address was causing it, and point you to the line that was causing it.

You should ALWAYS be running code in the debugger until you think it's completely bug free.

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!